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 - alext

Pages: 1 [2]
16
Automation Interface, Add-Ins and Tools / Re: Create Element
« on: March 16, 2009, 09:44:04 pm »
Okay...the reason why the item disappears is because I was trying to set the Type of the object with :

element.Type = newEAIssue.getType();

The type property that I'm refering to here is Display, Functional, Performance... the different Issue types.
Unfortunatly I can't set this property ... nor can I set
  element.Priority or
  element.Status

Is this even possible from C#? Or will I have to set these properties manually in EA?

17
Automation Interface, Add-Ins and Tools / Create Element
« on: March 16, 2009, 06:52:44 pm »
Could anyone tell me what I'm missing?
I see the element getting created in the project tree... but as soon as I refresh the tree, my new element "dissapears".

The idea is to create an element in a package called "Issues" and add the new element in the first diagram found in the "Issues" package.

Here is the code I'm using for this...


EA.Package selectedProject = this.getSelectedProject(repository);
EA.Package issuesModel = (EA.Package)selectedProject.Packages.GetByName("Issues");
EA.Diagram issuesDiagram = (EA.Diagram)issuesModel.Diagrams.GetByName("Issues");
repository.OpenDiagram(issuesDiagram.DiagramID);
EA.Element element = (EA.Element)issuesModel.Elements.AddNew(newEAIssue.getIssueName(), "Issue");
element.Notes = newEAIssue.getNotes();
element.Priority = newEAIssue.getPriority();
element.Status = newEAIssue.getStatus();
element.Type = newEAIssue.getType();
element.Update();
issuesModel.Update();
selectedProject.Update();
issuesModel.Elements.Refresh();
repository.GetProjectInterface().ReloadProject();

EA.DiagramObject diagramObject = (EA.DiagramObject)issuesDiagram.DiagramObjects.AddNew("", "Issue");
diagramObject.ElementID = element.ElementID;
diagramObject.top = 100;
diagramObject.left = 100;
diagramObject.bottom = 150;
diagramObject.right = 200;
diagramObject.Update();
issuesDiagram.DiagramObjects.Refresh();
repository.GetProjectInterface().ReloadProject();


What am I doing wrong or not doing at all?

Thank you!

18
Automation Interface, Add-Ins and Tools / Re: Create New Root Node
« on: March 10, 2009, 06:36:21 pm »
Thanks for your reply!

19
Automation Interface, Add-Ins and Tools / Re: Create New Root Node
« on: March 09, 2009, 06:40:09 pm »
Okay ... there's a Package.Update() however... and this seems to work!
Thanks for all the help!

20
Automation Interface, Add-Ins and Tools / Re: Create New Root Node
« on: March 09, 2009, 06:25:40 pm »
hmmm... I don't have a Package.Refresh() method.
Do I have an older version of the API? I have EA 7.1.834....

21
Automation Interface, Add-Ins and Tools / Re: Create New Root Node
« on: March 07, 2009, 02:11:07 am »
Allright...the following code still doesn't do anythin :

           EA.Package newModel = (EA.Package)repository.Models.AddNew("My Test", "");
            repository.Models.Refresh();
            repository.RefreshModelView(newModel.PackageID);
            repository.GetProjectInterface().ReloadProject();

22
Automation Interface, Add-Ins and Tools / Re: Create New Root Node
« on: March 07, 2009, 12:01:17 am »
hmmmm.... that doesn't seem to do the job.
I still don't see the new Module :(

23
Automation Interface, Add-Ins and Tools / Re: Create New Root Node
« on: March 06, 2009, 07:02:22 pm »
Thanks for your quick reply Frank...
I have tried the following :

EA.Package newModel = (EA.Package)repository.Models.AddNew("My Test", "");
repository.GetProjectInterface().ReloadProject();
repository.RefreshModelView(newModel.PackageID);


But unfortunatly nothing happens (= MyTest does not appear as a new Model)

What am I doing wrong?

Thanks for your help!

24
Automation Interface, Add-Ins and Tools / Create New Root Node
« on: March 06, 2009, 01:08:12 am »
Does anyone know if there's  a way for creating a new Root node from C#?

25
Automation Interface, Add-Ins and Tools / Re: Java don't works
« on: February 07, 2009, 02:58:06 am »
I have had the same problem...
1) make sure you don't have any EA processes running for you first run.
2) make sure you close the repository correctly

 repository.CloseAddins();
 repository.CloseFile();
 repository.Exit() //fails sometimes
 repository = null;


You can also call GC after this.

26
Thanks for your reply Oliver, but this seems to throw me an error when I do a Repository.GetModels().
I get an "Internal application error".
If I open a Repository through openFile...I have no Issues (not always at least), but I would like to get the Models for the open instance of EA.

My plan is to open a network repository and then use it as if it where sitting on my local machine...for this I need a current running EA instance
reference.

Thanks!

27
Does someone know what the Java equivalent is for the follwing code:

using System.Runtime.InteropServices;
...
object obj = Marshal.GetActiveObject("EA.App");
EA.App app = obj as EA.App;
EA.Repository rep = app.Repository;

This is supposed to get a reference to the running instance of EA.

Thanks! :exclamation

28
Automation Interface, Add-Ins and Tools / RunReport on an Object GUID
« on: February 07, 2009, 02:51:28 am »
I would need to run a RTF template on a specific object within a Repository and not on an entire package.

so for ex. If I have a the following structure MyProject\Use Case Model\My First UC Package\MyFirstUC.
If I want an RTF documentation of "MyFirstUC" I need to pass the package GUID... this will print out all objects under "My First UC Package".
But what if I have several UC in my package ... and I want an RTF document for only one UC... how can I do this from the API??

I know this should be possible since you can print ONE specific object if you run a SQL query that has an "Object_id" in.

Thanks for your help!



Pages: 1 [2]