Thank you so much leex. Works perfectly. Hate to be sound a ingrate, but I think for me clicking the middle start point first and then imputing the number would more resemble the way I’ve become accustomed to using line commands. That way I can use the same button to either enter a number or click anywhere to end the line from midpoint.Is that possible?
Here is another option, with prompt for the length in the middle of the command:
-_Runscript (
Call Rhino.Command("_Line _BothSides _Pause _NoEcho -RunScript (" & chr(13) & "Dim r : r=Rhino.GetReal(""Line length?"") : if not isnull(r) then Rhino.SendKeystrokes(Cstr(r/2))" & chr(13) & ")")
)
Note if you want to skip typing the number, just hit Enter or RMB to pick the distance by mouse;
Also, if you need another option like Perpendicular etc. you would need to modify the above by either adding another _Pause after the first _Pause or the actual option like _Perpendicular etc.
the reason i’m posting it is because when extruding bothSides, it works the way being requested in this thread…
the entered distance will be the overall distance of the extrusion as opposed to each side extruding this amount.
Hello Jarek, This version " -_Runscript (
Call Rhino.Command("_Line _BothSides _Pause _NoEcho -RunScript (" & chr(13) & “Dim r : r=Rhino.GetReal(”“Line length?”") : if not isnull® then Rhino.SendKeystrokes(Cstr(r/2))" & chr(13) & “)”)
) " Runs as intended (asks for midpoint and then input total distance) in Rhino 5, but works as normal “Line from Midpoint” in Rhino 6. Can you please have a look if you have the time? I use the command every day. PS the other version (input distance and then click midpoint works in both Rhino 5 and 6 " _-runscript (
setlocale 1033
Lng= rhino.getReal()
rhino.command “_Line _BothSides _pause " & Lng/2 &” _pause "
Thank you EtRec