Python Snap method doesn't work


#1

I tried running the sample script in the help file, and Snap doesn’t seem to be working.

import rhinoscriptsyntax as rs
if not rs.Snap(): rs.Snap(True)

If I turn it on manually and go the other way (attempt to shut it off) it still doesn’t work.

import rhinoscriptsyntax as rs
if rs.Snap(): rs.Snap(False)

Thanks,

Dan


#2

Doing a little investigating I find that the problem is in the application.py script. I believe “modelaid” should be “ModelAidSettings”.

This script toggles the Snap on and off:

import Rhino
if Rhino.ApplicationSettings.ModelAidSettings.GridSnap == False:    
    Rhino.ApplicationSettings.ModelAidSettings.GridSnap = True
elif Rhino.ApplicationSettings.ModelAidSettings.GridSnap == True:
    Rhino.ApplicationSettings.ModelAidSettings.GridSnap = False

Thanks,

Dan


(Dale Fugier) #3

Got it, thanks for reporting.

– Dale