Book a Demo

Author Topic: How to work with currently-selected diagrams only?  (Read 2906 times)

panfiluta

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
How to work with currently-selected diagrams only?
« on: December 30, 2008, 07:43:11 pm »
Hi all,

I'd like my add-in to work with the selected diagrams only.
I'm using C#, so I tried something like this:

EA.Package = ...
foreach (EA.Diagram diagram in package.Diagrams)
{    
      if (diagram.SelectedObjects.Count > 0)
      {.....


But when there is no diagram selected I get an error message saying that I cannot do .SelectedObjects.Count on hidden diagrams.

Is there a way to find out whether the diagram is hidden or not?

Thanks a lot.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to work with currently-selected diagrams o
« Reply #1 on: December 31, 2008, 08:18:19 am »
I think the diagram returned by Repository.GetCurrentDiagram is the only safe diagram to use SelectedObjects on.