Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: fcavassini on November 13, 2003, 01:55:58 pm

Title: getting and working with current selected objects
Post by: fcavassini on November 13, 2003, 01:55:58 pm
Hi everyone

I'm developing an Add-In for EA in VB 6
I want to get all objects selected in the current diagram:
   For i = 0 To pEAR.GetCurrentDiagram.SelectedObjects.Count - 1
       Set obj = pEAR.GetCurrentDiagram.SelectedObjects.GetAt(i)
   Next i

But the obj that I receive is an Object without Interface, and I can't convert it to an Element or other class.

hope you can help me

thanksss!!!!

Fabio
Title: Re: getting and working with current selected obje
Post by: Phil_Bachmann on November 23, 2003, 03:37:19 pm
SelectedObjects is a collection of diagram objects.

Try

dim DiagramObj as EA.DiagramObject
For Each DiagramObj in pEAR.GetCurrentDiagram.SelectedObjects
...
Title: Re: getting and working with current selected obje
Post by: fcavassini on November 24, 2003, 02:52:54 pm
Thanks Phill!!