Get selected Geometry with ObjectTable

ghpython

#1

Hi all,

i try to get selected objects from the document with the ObjectTable.

import scriptcontext as sc
import rhinoscriptsyntax as rs
import Rhino as rh

sc.doc = rh.RhinoDoc.ActiveDoc
ObjTa = sc.doc.Objects
Obj = rh.DocObjects.Tables.ObjectTable.GetSelectedObjects(ObjTa,False,False)
sc.doc=ghdoc

print Obj

I dont know how to get the selected geometry from the printed result.


#2

Hi flokart, does this help?

objs = sc.doc.Objects.GetSelectedObjects(False,False)
for obj in objs: print obj.Geometry


#3

Of course that Helps …but how i could know that?.
How do YOU know that.


#4

Maybe it is easier to learn python / rhinocommon outside of grasshopper. Then you can set breakpoints and inspect the content of the objects:


#5

OOO WOW i didnt know that the RhinoPython Editor provides so much Info.
Do you know if there are efforts from mcneel to bring this kind of features to the grasshopperPython editor?


#6

The editor-question (IDE) is frequently discussed here. I would not expect too much…