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?
Cheers,
Max
Jarek
June 28, 2017, 6:43am
2
Hi,
They can either use " " when typing in command line or you can use .StringBox method that does not have this problem.
hth,
–jarek
dale
(Dale Fugier)
June 29, 2017, 3:25pm
3
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")
gs.GetLiteralString()
if (gs.CommandResult() == Rhino.Commands.Result.Success):
print gs.StringResult()
http://developer.rhino3d.com/api/RhinoCommonWin/html/M_Rhino_Input_Custom_GetString_GetLiteralString.htm
– Dale
1 Like