Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jafuentes on December 08, 2010, 04:36:20 am

Title: Hide elements of diagrams using C#
Post by: jafuentes on December 08, 2010, 04:36:20 am
Hello,

I need hide elements of a diagram. For example, in a diagram there are many classes, stereotypes... and I would want to hide classes. I´m using C#.

Is this possible? there is any method associated with the elements to hide these items?

Thanks. Bye
Title: Re: Hide elements of diagrams using C#
Post by: Eve on December 08, 2010, 08:39:45 am
Remove something from Diagram.DiagramObjects would be the only way.
Title: Re: Hide elements of diagrams using C#
Post by: jafuentes on December 11, 2010, 11:01:59 pm
I have hidden the items now. I remove the diagramObject to achieve this and if I want to show the items, I add the diagramObject again.

The problem now is that when I delete a diagramObject, the diagram does not refresh automatically. I need to close the diagram and reopen it. Is there a method to update the diagram?

Thanks.
Title: Re: Hide elements of diagrams using C#
Post by: jafuentes on December 11, 2010, 11:05:46 pm
I've solved!

Code: [Select]
Diagram currentDiagram = r.GetCurrentDiagram();

r.ReloadDiagram(currentDiagram.DiagramID);

Where r is a Repository.

Bye.