Cannot SelectObject referring to GUID

What I am trying to do is to get the object by GUID into python script and SelectObject as below.
However, I get the error Runtime error (MissingMemberException): 'AttributedGeometry' object has no attribute 'Select'
Can anyone tell me why this code does not work and how to revise it?

Below is the part of the code written in ghPython

def Explode(rc):
rs.SelectObject(rc)
rs.Command("Explode ", False)
rs.UnselectAllObjects()
return rs.LastCreatedObjects()

a=Explode(Geometry)

Hi @Katsuya_Obara

The Grasshopper document has no selection, as it’s view-less and has no picking. Also, you can only run commands in the Rhino document. If you want to make this script work, you have to redirect the script document to the RhinoDoc.

See What is ghdoc in the common GhPython question.

Thanks

Giulio

–
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like