How to use GetSelectedObjects


#1

Hi,

How can I get the objects that I have selected with doc.Objects.GetSelectedObjects(False, False)?

Because I’m not able to use this.

Dim SelectedObj = doc.Objects.GetSelectedObjects(False, False)

Also if I do SelectedObj(0). No further possibilities.


(Menno Deij - van Rijswijk) #2
For Each obj as RhinoObject in SelectedObj
//    do stuff
Next

SelectedObj is of type IEnumerable<RhinoObject>, so you can iterate over its contents.


#3

Ah like that :slight_smile: Thought it would be able to use it as a List type of thing :smile:
Thanks