Author Topic: Hide elements of diagrams using C#  (Read 3231 times)

jafuentes

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Hide elements of diagrams using C#
« 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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Hide elements of diagrams using C#
« Reply #1 on: December 08, 2010, 08:39:45 am »
Remove something from Diagram.DiagramObjects would be the only way.

jafuentes

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Hide elements of diagrams using C#
« Reply #2 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.

jafuentes

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Hide elements of diagrams using C#
« Reply #3 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.