Python Snap method doesn't work

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)



Doing a little investigating I find that the problem is in the 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



Got it, thanks for reporting.

– Dale