! _Line _BothSides

Hi all!

! _Line _BothSides

Each side puts the value is entered

For example, if entered 1, it turns 2
1 + 1 = 2

How to make that line was from the center (perhaps both sides)
And if it must be entered 1 to get 1

For example, if introduced 1, it should be obtained 1
0.5 + 0.5 = 1


Hi leex,

See this recent discussion:

HI Jarek

I read it, but the solution is not found.
I would like to ask whether there is a separate commands to the mathematical division of numbers?

I think that here can help macro.
The algorithm is roughly as follows

_Line _BothSides
_mathematical division conmmands = …/2

a way:
_-runscript (
setlocale 1033
Lng= rhino.getReal()
rhino.command “_Line _BothSides _pause " & Lng/4 &” _pause "


I type the whole number divided by 2 in the command line , on a both sides line or midpoint line. Probably not your solution. —Mark

Hi JavierG

Your script works fine!
but I changed the value of 4 to 2

_-runscript (
setlocale 1033
Lng= rhino.getReal()
rhino.command "_Line _BothSides _pause " & Lng/2 &" _pause "


Can I change the script so as to enter a numerical value inside the commands, rather than before ?

Hi Mark!
I just want to automate the division into two

New to this . How would I use this script and can I create a button (icon) for this script? Thanks

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?

Was mistaken. Only the button I changed works that way, I thought all copies of the line from midpoint button now work in that manner.

I hope so too.
I would like to enter a numerical value inside the rhino.command .

Maybe someone will be able to implement it. I can not.


It’s not my works, so we have to thank the Javier :slight_smile:

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.



1 Like

Jarek Hello!
Job well done! :muscle:
I like
Many thanks!!

The only thing
When torsional mouse wheel (MMB) to change the size of the scene fades sight (first point)

Thanks Jarek…you’ve helped me before. works for me.

I see, not much can be done about it I’m afraid; this is pretty hacky way of making it work already :wink:

pretty far off topic but…

here’s a python script i use for multiple curve extrusions:

ExtrudeMulti.py (2.6 KB)

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

) "