ConstructionLine vs ConstructionPoint

I’m a bit confused about construction lines vs construction points.

The ConstructionLine docs mention both infinite, finite and semi-finite lines, but I can’t find a way to create finite or semi-finite guidelines from the UI. There is a code example for creating a finite guide line but I can’t remember ever having seen something like it in SU. Can these not be created from the UI?

A ConstructionPoint on the other hand can be created from the UI with a “trail” line, if you click on vertex with Tape Measure and then somewhere in space. However, a construction point with a line/vector doesn’t seem possible to make through the API.

Is there an overlapping responsibility of these classes and confusion of what they should be used for?

I use a construction line plugin which draws finite guides, and optionally endpoints ( cpoints). Not at computer now, but when I am I’ll send you the plugin code.

Here’s the plugin I was referring to.
OOPS - wrong plugin uploaded at first - will try again
This is just the one ruby file.
clinetool.rb (12.9 KB)

It produces finite construction lines, with or without cpoints at the ends (Option/Alt toggles the points off or on).
image

Maybe looking at the code will help you understand how it works, if the SU Ruby API isn’t clear?

Beyond my own skill level, as yet, in SU Ruby.

1 Like

There’s also the CB_Cline plugin which converts edges to construction lines.

That’s the one I uploaded by mistake first, but perhaps it might also help.CB_Cline.rbz (1.5 KB)

Of course, the starting method is Entities#add_cline. The API docs only mention the infinite (provide a point and a vector to define the line) and the finite (provide a start point and an end point) varieties. I believe (but can’t check just now) you can make a semi-infinite guide line via the API by first creating an infinite cline and then setting either its start or end. I don’t think the GUI provides a way to create either a finite or semi-infinite guide line.

In the API you can replicate the visual effect of a guide point with a tail by creating a cpoint and then a finite cline from the reference point to the cpoint location. However, unlike in the GUI, they won’t be treated as a single thing and the finite cline will be selectable.

1 Like

If add_cline() is given two points it draws a cline between them.
But when it is given a point and a vector it [initially] makes an infinite cline in both directions, but then you can set either its start or its end point to make if infinite in one direction only.
Obviously setting both a start and an end point is like making it a fixed length cline initially…