XL line tool


This topic has been mentioned once before, but there was no solution at the time. I’m hoping that maybe now, someone might be able to suggest a workaround.

I’ve been using Rhino for 10 years, primarily for architectural design as a 3D package in combination with AutoCad. However, I’m trying to shift to doing all 2D work in Rhino from now on if possible.

There’s one command that I really miss, which I can’t work out how to make in Rhino. In Cad, I have the ability to use XL Lines (infinite lines) which I have set to a hotkey. This means I can push one button and automate either an infinite horizontal (x axis) or vertical (y axis) to appear where I have my cursor. In Rhino, I use the line or polyline command (which is also to a hotkey) but it requires selecting where the line will start and where the line will end. Although, trying to get around this seems extremely lazy, when you spend all day drawing straight lines the extra clicking of start points and end points definitely adds up.

Is there a way to create a script, or tool to allow me to press one button that will create a straight (vertical/horizontal) line at the location of my cursor, without having to select where it starts and will end? Doesn’t have to be infinite, just a long line…


Hi - Have you checked the AddGuide command?

Hi Wim,

The query was not about adding guides, it was about creating a continuous (either horizontal or vertical) line with the tap of one button; without having to click start point and end point. Just hit one button, and it appears where your cursor is to place it. Thanks

Hi -

Does that mean that you have tried the AddGuide command?
I’m trying to get more information out of you so that a feature request can be created…
If the command had a vertical and horizontal option, would it do what you are asking for?

You can do that with scripting and with Grasshopper, yes. The tricky point here is the “long” part…

Hi Wim,

Once again thanks for the response. I know the AddGuide command yes, but it’s not what I’m looking for. The AddGuide command produces continuous guides, which cannot be used as lines (as far as I’m aware), which also disappear when you’re not drawing lines on top of them. I can’t trim guides, or fillet them, or offset them, or use them to build geometry.

XLines allow me to create a continuous line, which I can then trim, offset, fillet etc. I can’t think of a way to do this as (once again as far as I’m aware) all the rhino commands for lines ask me for a beginning and an end point. Is it possible to make lines continuous, as with the guide commands? Thanks

Hi - Thanks for clarifying your requirements!

There isn’t any native Rhino command to do this, no. Here’s a simple Grasshopper graph that will place a vertical “long” line at a single mouse click. When there are objects in the scene, the line will be 10 times the size of the bounding box. When there are no objects (*) in the scene, the line will be from -1000 to +1000.

(*) or when there only are SubD objects in the scene. Grasshopper was written long before SubD objects were introduced in Rhino and the component I used doesn’t take those into account.

To use this, run the Rhino GrasshopperPlayer command and select the file. Then simply pick a point.
You can create a keyboard shortcut, alias, or toolbar button to have GrasshopperPlayer select this file for you.

A horizontal line is a bit more complicated since it would depend on which construction plane you would want to place it. A quick way out would be to create one graph for a horizontal line in the Front/Back viewport and a different graph for a horizontal line in the Right/Left viewport.
LongVertical.gh (14.9 KB)

Thanks, really appreciate the help!

Note putting long lines into the scene will increase the bounding box of the scene and potentially mess with the display and camera. Wim, does your thing know about previous lines added or do they get bigger and bigger if you use the too repeatedly?


Darn - they just get bigger and bigger → approaching infinity as initially requested :sunglasses:

Ship it!