GetString INCLUDING spaces (instead of the space bar ending the command)

Hello everyone,

I have a task where I want to ask the user to input an entire sentence - this will of course include spaces.
If I use rhinoscriptsyntax.GetString(), the input ends as soon as you hit the space bar.

Is there any way to get around this?



They can either use " " when typing in command line or you can use .StringBox method that does not have this problem.



Hi @MaxMarschall,

Using RhinoCommon, you can use a GetString object and use it’s GetLiteralString method.

For example:

import Rhino
gs = Rhino.Input.Custom.GetString()
gs.SetCommandPrompt("Enter some string")
if (gs.CommandResult() == Rhino.Commands.Result.Success):
    print gs.StringResult()

– Dale

1 Like