Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - marine1981

Pages: [1] 2 3 4
1
Hello,
How can I get the associated class from an instance/object in C#?
Thanks

2
Thanks Geert. Now, I develop a Script with JScript. It is a validation script.

3
It does not work with the element ID. I don't know the elementID because I have got some elements in the diagram. I know only the elementtype. One element in the diagram is a Requirement or later a activity.

4
Hello,
How do I get an element from the diagram?
My first Idea:
Code: [Select]
for ( var j = 0; j < diagrams.Count; j++ )
{
  currentDiagram = diagrams.GetAt( j );
  if (currentDiagram.Type == "Activity")
  {
   //Count Elements in the Diagram!
   Session.Output(currentDiagram.DiagramObjects.Count);
   for( var k = 0; k < currentDiagram.DiagramObjects.Count; k++ )
   {
   //Question: How do I get an element from the diagram?
      
   }
}


Thanks


Sven

5
Hello,
How can I get the "Operations" (Methods)/"Attributes" by name from a "Class"? I use JScript/C#.

Thanks

6
Thanks! It does work!

7
How I can create a Composition? With:
Code: [Select]
NewConnector = (EA.Connector)NewElement.Connectors.AddnNew("","Composition");
I get with this code only a aggreation and not a Composition.

Thanks


Sven

8
Reload without a newstart does not work. First after a new start I can delete the elements. Why?

9
I see a mistake, now. I don't can manual delete the new element in the Project Browser.
Do you have got any reason for this manner?

10
Your information was helpful.

I modified you example for a element:
Code: [Select]
EA.Package ParentPackage = Repository. GetPackageByID(NewPackage.ParentID);
EA.Element NewElement = (EA.Element)ParentPackage.AddNew(Convert.ToString(elementName), "UseCase");
NewElement.... = "...";
An it does work!

Thanks

Sven

11
Now, I have got a further problem with the new element in the Project Browser. I create the element with:

Code: [Select]
EA.Element NewElement = (EA.Element)NewPackage.Elements.Add(...);
The program creates the element in th new Package in the Project Browser. But I need the element in the same level like the new package and not under the package. How I can move the element and How I can set the position at the creation in the tree? I have tested with PosTree but without any success. Do you have got any idea?

Thanks


Sven

12
THANKS! It does work, now! :)
My solution:
Quote
//Reload Project Browser
Repository.RefreshModelView(0);
//Select new Diagram in the Prjoject Browser
Repository.ShowInProjectView(NewDiagram);
:)

13
Hello,
thank you for your helpful answer. RefreshModelView(0) does work, but it closes the folder tree/folder structure and I don't want this kind of behavior.
I have inserted the package ID(RefreshModelView(PackageID)), too. But this way is not better.  Do you have any idea?

14
I have fixed that but i does not work with one of the both fixes.

Code: [Select]
Repository.AdviceElementChange(NewPackage.Element.ElementID);or
Code: [Select]
Repository.RefreshModelView(NewPackage.PackageID);

15
I think he need a update like "reload project".
After then I have got the right view.
When and Where it needs a update?

Pages: [1] 2 3 4