Book a Demo

Author Topic: Close Tabs opened by LayoutDiagramEx  (Read 3582 times)

Bencrush

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Close Tabs opened by LayoutDiagramEx
« 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 :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Close Tabs opened by LayoutDiagramEx
« Reply #1 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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Close Tabs opened by LayoutDiagramEx
« Reply #2 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

Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Bencrush

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Close Tabs opened by LayoutDiagramEx
« Reply #3 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