Book a Demo

Author Topic: Find in Diagram  (Read 3466 times)

neil_albiston

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Find in Diagram
« on: December 18, 2010, 04:47:27 am »
Is there an efficient way to do a script version of the Element --> Find In Diagrams menu item?

So far the only option I've found is to check the Ids of every diagram object in every diagram. Not ideal.

Basically I want to check an element is not included in any  diagrams before it is deleted. Any suggestions?

Thank you in advance,

Neil

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Find in Diagram
« Reply #1 on: December 19, 2010, 02:53:43 pm »
Neil,

In that case I'd use SQL. Something like
Code: [Select]
myRepository.SQLQuery("select Diagram_ID from t_diagramobjects where Object_ID = " + myObjectID.ToString());Should give you diagramID's of all diagrams using this object in a fraction of a second.

Geert

neil_albiston

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Find in Diagram
« Reply #2 on: January 05, 2011, 03:24:43 am »
Thank you Geert.
Yet again one of your answers has solved my problem and opened up an entire undocumented chapter of possibilities.

... You should write a book.... I'd buy it.

Cheers,

Neil

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Find in Diagram
« Reply #3 on: January 05, 2011, 07:13:16 pm »
Quote

... You should write a book.... I'd buy it.

Honestly, I've been thinking about that, but then again I don't seem to find the time.
Maybe I could start with some EA related blog posts...  :)

Geert