Multiple parameters and options in one command line with Python

script
rhinopython
command
python

#1

Is there a way in Rhino python to address multiple dimensions or options in one single the Rhino command line?
Like in a normal Rhino command where you for example have to define the extrusion distance in the command line and then in parenthesis have the possibility to change the direction, delete input etc.
This would be very useful so that you don’t have to hit enter 5 times to confirm parameters that you usually don’t want to change.
I’m not sure if I’m clear. I’m new to Rhino python and not sure about the whole terminology. So it might be possible that I oversaw a thread or an example that explains my question.
In my example I would like to select one or multiple curves and then have a toggle option and some dimension values.


#2

Yes, it certainly is possible, but not with rhinoscriptsyntax, for that you would have to dive into some RhinoCommon. If that interests you, here is a page with sample code.

That being said, I found that it is often just as easy to ask the user for a series of choices sequentially rather than all on one command line, there are just as many mouse clicks involved… The advantage of having the command line options is you can change your mind on any of them until you validate with Enter…

HTH, --MItch


#3

forum member @emilio gave me an example of doing this once which i was able to use in a script… the post where he provided some examples is here:

further in the thread is a script i made using emilio’s share.


#4

Thank you Mitch and Jeff!

But guess I rather stick to rhinoscriptsintax for the moment.
I don’t feel comfortable to dive into RhinoCommon just yet;)


#5

Hi Mitch

I also find command options useful when the script could use default values (possibly using latest used values as defaults)
You just set those options to their default values in the script and if they are what the user wants there is no need for extra clicks.

Hehe … OK … I’m often quite lazy. :slight_smile:

Regards