Inserting Values during command sequence with Scripted return value

Sometimes when one uses a command there might be a few steps before getting the result.
One of those steps might be entering a numerical value.
‘Playing’ around with formulas during one of those steps at the command line can be cumbersome when you might want to do some deletes, backspace, etc.
When I try with a script I seem to only be able to get values on the command line when there is no active command. If I already had entered a command manually and get to a stage where a numerical value is required, I can’t at that point press ‘Run Script’ from the RhinoScript Editor to enter the value, unlike, again, when there is no active command. For a simple example:

Option Explicit
Call Main()
Sub Main()
       Dim x
       x = 5 + (2 * 6)
       Rhino .Print(x)
End Sub

Just wondering if it’s possible to do this kind of workflow with scripts and manually entered commands,
instead of writting more ‘complete’ scripts that accomplish the same without using manual command entries.

I moved this to the Scripting category so it will be more likely to be seen by someone that can help.

Thanks…must have missed that catagory as I scrolled down options.

Hi @BabaJ,

Try this:

Sub Main()
       Call Rhino.SendKeystrokes(5 + (2 * 6))
End Sub

See the RhinoScript help file for details.

– Dale

Thanks Dale, but that doesn’t work.