Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Mithal on November 02, 2010, 08:04:06 pm
-
Hi how can i get all the diagrams when a project is opened. I can add a textelement to a diagram, so i wan to be abble to add textelement to all the diagrams for existing projects.
Currently i can add i a textelement to a a new diagram.
I tried using the EA_OnPostOpenDiagram but this event does not fire.
First prize would be to get all the diagras when the project is opened.
Thanks :)
-
Mithal,
I would try the event EA_FileOpen.
That will fire when a model is opened.
If you then need all the diagrams in that model I would use
Repository.SQLQuery to get a list of all diagram ID's and then use Repository.GetDiagramByID to get each diagram.
Depending on the number of diagrams in your model this might take a while.
Geert
-
Cool thanks, will c if this improves the performance.
I am Currently using Repository.GetTreeXML(0) which takes while.
and then eg.
newDiagram = (EA.Diagram)Repository.GetDiagramByGuid("{D6C1A865-52C9-44dc-AC04-9F933F76EFE0}");