Lock curves script


#1

Hi,

I tried the following script from the Python 101 but did not work. Could you tell me why?
I have created several curves and Run the script but nothing happened.

import rhinoscriptsyntax as rs
def lockcurves_nofail():
    curves = rs.ObjectsByType(rs.filter.curve)
    if not curves: return False
    rs.LockObjects(curves)
    return True

(Dale Fugier) #2

How about this?

import rhinoscriptsyntax as rs

def LockCurves():
    curves = rs.ObjectsByType(rs.filter.curve)
    if curves:
        rs.LockObjects(curves)
    
if __name__=="__main__":
    LockCurves()

– Dale


#3

Thank you it works brilliant. I think I got it.