Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Colin Richardson on August 04, 2010, 12:19:43 pm

Title: How to get a collection of open diagrams?
Post by: Colin Richardson on August 04, 2010, 12:19:43 pm
Must not have my caffeine levels at optimal...

 :-/
Title: Re: How to get a collection of open diagrams?
Post by: smendonc 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.
Title: Re: How to get a collection of open diagrams?
Post by: Colin Richardson 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
Title: Re: How to get a collection of open diagrams?
Post by: Ian Mitchell 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' ?
Title: Re: How to get a collection of open diagrams?
Post by: Geert Bellekens 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