Author Topic: Adding TextElement to diagram  (Read 3887 times)

Mithal

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Adding TextElement to diagram
« 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 :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding TextElement to diagram
« Reply #1 on: November 03, 2010, 05:31:47 pm »
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

Mithal

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Adding TextElement to diagram
« Reply #2 on: November 11, 2010, 09:58:14 pm »
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}");