Author Topic: How to get a collection of open diagrams?  (Read 12293 times)

Colin Richardson

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
How to get a collection of open diagrams?
« on: August 04, 2010, 12:19:43 pm »
Must not have my caffeine levels at optimal...

 :-/

smendonc

  • EA User
  • **
  • Posts: 148
  • Karma: +5/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: How to get a collection of open diagrams?
« Reply #1 on: August 05, 2010, 08:32:44 am »
I don't think there is a way to do this directly through the api.  I created an Addin that used the EA_OnPostOpenDiagram and EA_OnPostCloseDiagram to keep a list of open diagrams updated.

Stan.

Colin Richardson

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: How to get a collection of open diagrams?
« Reply #2 on: August 05, 2010, 09:46:09 am »
Thanks Stan - that worked a treat!

Or it did once I worked out that Repository.CloseDiagram doesn't invoke EA_OnPostCloseDiagram

 :D

Ian Mitchell

  • EA User
  • **
  • Posts: 506
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: How to get a collection of open diagrams?
« Reply #3 on: January 20, 2021, 02:11:09 am »
is this still true? There really is no API function to either 'list all open diagrams' or better still 'closeAllDiagrams' ?
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to get a collection of open diagrams?
« Reply #4 on: January 20, 2021, 02:26:37 am »
If you want to close all the diagrams you could combine
Repository.GetCurrentDiagram()
and
Repository.CloseDiagram()

The only problem is when you have other non diagram tabs (search window, add-in window, database manager, etc...) open

Seems like you still need to keep the list of open diagrams yourself as there is not way to close the "current active tab"

Geert