How to lock/unlock rhino-geometry from grasshopper?

Hi there,

I am trying to lock or unlock geometry in Rhino from within grasshopper.
I’m reading in my curves using the geometry pipeline and then I managed to paste this ghpython script together (see below), but it doesnt seem to change the lock/unlock status of any of the curves I’m reading in.

Any help is appreciated.

Hi
try this:

import rhinoscriptsyntax as rs
import Rhino.RhinoDoc as  rr
import scriptcontext as sc

sc.doc = rr.ActiveDoc

if(lock):
    rs.LockObjects(geos)
else:
    rs.UnlockObjects(geos)

sc.doc = ghdoc

2 Likes

Thank you, NARUTO. This works like a charm!