Calling editor components such as 'Snap' from custom scripts

I know how to call Unitys menus and functions (such as create cube, light etc)

but can I change the Snap settings by script?

I.e link from script to change to either the x,y or z snap buttons a button press,
and mimic the snap to ALL buttons using a custom button.

Is this possible, if it is how? and is there a reference page on how to call each of these functions?

Would it be something like Get Component ? Get Component of that window and then = it’s value to something new?


Unfortunately, a lot of the editor-specific stuff is hidden. You can access it via reflection though- but that’s a whole different can of worms.