Rs python script example


I thought it will be easy to find, but not…
I’am looking for some basic python rhino script command example…

something like a python box with a true/false button, when I press the button it create a point at 0,0,0
I have some skills with rhino command using the lunch box “send command” tool like this :

but I can’t do this simple stuff in python
just want the beginnig things :
1- bake a point on button press
2- return a “print message” like True or a value in the a output…

here is what I did but don’t work :
script (7.1 KB)

thanks for help

Have you seen the Rhino Python primer? It’s a good introduction to Python scripting with Rhino

Have a look at the rhinoscriptsyntax documentation:

Most of these come with an example. Also, be aware that you must set the script context to target the Rhino document explicitly when baking to it from GHPython (see this thread for instance).

ok, thank you very all of this seems a litlle bit as chinese for me for the moment but very interessant too…
thanks guys

the principal problem was that I was writing “rs.Addpoints” instead of “rs.Addpoint”