Author Topic: getting and working with current selected objects  (Read 11968 times)

fcavassini

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
getting and working with current selected objects
« 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

Phil_Bachmann

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: getting and working with current selected obje
« Reply #1 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
...

fcavassini

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: getting and working with current selected obje
« Reply #2 on: November 24, 2003, 02:52:54 pm »
Thanks Phill!!