Select locked objects!

Hi,guys,Can you give me a script code that can select objects locked? Thank you in andvance!

You cannot select locked objects…because they are locked.

What are you trying to do?

I want unlock the object specified, I don’t want to find it’s layer and unlock the layer.I just want to select the locked object and get it’s layer the unlock then layer by code!

If you are using RhinoScript, then you can use either AllObjects or LockedObjects to get every object or just the locked objects, respectively. Once you have these objects, you can use the UnlockObject or UnlockObjects methods to unlock them.

http://4.rhino3d.com/5/rhinoscript/index.html

Does this help?

If i lock many layers, I just want select the locked object i specified and get it’s layer to unlock!
Could you add a parammeter to getobject function to allow select the locked object?

No we cannot because you cannot pick locked objects. If you could pick them, then they wouldn’t be locked. :wink:

A script could hide all unlocked objects, unlock all locked objects and layers, wait for the selection, get the layer(s) then lock the objects and layers again and then show the objects that were hidden again. Then Unlock the layer(s) and select the object(s)

1 Like

Thank you. it’s a good circuity solution!