Hi
The attached Python script extract a surface from a polysurface.
It’s possible get also the id of the object without another pick?
Ciao Vittorio
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def ExtractSrf(str):
rs.UnselectAllObjects()
rc,surfaceref=Rhino.Input.RhinoGet.GetOneObject(str,False, Rhino.DocObjects.ObjectType.Surface )
if rc!=Rhino.Commands.Result.Success: return
rs.MessageBox(surfaceref)
sup = surfaceref.Face()
if sup:
brep=sup.DuplicateFace(True)
superficie=scriptcontext.doc.Objects.AddBrep(brep)
scriptcontext.doc.Views.Redraw()
return superficie
if __name__=='__main__':
sup=ExtractSrf("seleziona superficie da estrarre")