Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Bencrush on August 09, 2010, 07:08:44 pm

Title: Close Tabs opened by LayoutDiagramEx
Post by: Bencrush on August 09, 2010, 07:08:44 pm
Hi

i am using LayoutDiagramEx in my Addin to layout my diagrams. But this method opens a new tab for every diagram. My problem is, that there are serveral hundreds of diagrams to layout and EA always crashes, because of too many tabs.

Is there a way to directly close or even just not open a new a tab when layouting an diagram?

Thank you very much :)
Title: Re: Close Tabs opened by LayoutDiagramEx
Post by: Geert Bellekens on August 09, 2010, 07:27:47 pm
Ben,

You could try to set Repository.EnableUIUpdates to false, and if that doesn't work close the diagram after layouting it by Repository.CloseDiagram (long DiagramID)

Geert
Title: Re: Close Tabs opened by LayoutDiagramEx
Post by: Paolo F Cantoni on August 09, 2010, 07:36:18 pm
Hi Ben?

I had the same problem...  Basically, you need to keep track of open and closed diagrams yourself.

If you are explicitly opening the diagrams with your Add-In, you need to close it yourself.

I think there was some discussion recently on how to detect if a diagram is already open (without resorting to using broadcast events).

HTH,
Paolo

Title: Re: Close Tabs opened by LayoutDiagramEx
Post by: Bencrush on August 09, 2010, 07:43:41 pm
Thank you for your fast replies :)

I tried Repository.CloseDiagram (long DiagramID) as Geert said and it worked perfect. I guess I was blind, not finding it in the User Guide.
Thank you very much :)

Ben