Continuous line made from parts

Continuous line made from parts

Anonymous
Not applicable
1,883 Views
5 Replies
Message 1 of 6

Continuous line made from parts

Anonymous
Not applicable

Dear all

 

Could you help me with a solution which will really help speed drawing.

 

I wish to draw a continuous line, similar to a polyline, but using the line command.

 

The difference is that although the lines join (say filleted with radius = 0) the lines are only determined by picking two points for each.

 

For example:

 

I pick a start point (1), then a second (2). A straight line starts at (1) and runs through point (2) or is on a bearing as such.

 

I then pick two more points (3) and (4). This determines the bearing of the next line, but is 'filleted' to the previous (1) and (2).

 

I then pick two more points (5) and (6)....continuing the proceedure of above.

 

So I am not drawing a continuous line, end point to end point, but 'bearing defined by two points' with a fillet to join.

 

Currentlt I draw a line between two points, then another line between two points, then fillet, then a line between two points, then fillet.....

 

Kind regards

 

 

Paul. 

0 Likes
Accepted solutions (1)
1,884 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

One thing you could try is to draw all your unconnected Lines, then use PEDIT with the Multiple option, select them all, and use the Join option with a big-enough fuzz factor to connect them all.  That puts the connecting of them together into one operation, no matter how many of them there are, without needing to switch back and forth between Line and Fillet commands.  I imagine that could be automated into a routine that would add each Line to a selection set as you draw them, and calculate the distance between the start point of each one [after the first] and the end of the previous one, with the longest such distance used as a basis for calculating the fuzz factor it would feed into PEDIT.

Kent Cooper, AIA
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks, I can try this, but I think it will get confused where lines are close to one another, but iterations down the road and connect close lines that shouldn't be connected.

The application for this is tracing point clouds, for example walls. We run down the left face of the wall, the return, then follow back along the other side of the wall. Your suggestion, whilst helpful, I think will make the 'fuzz' connect other bits first...

Regards


Paul.
0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

Give this a shot [in pretty simple terms, without a lot of the controls, etc., that could be added]:

 

(defun C:FLAD (/ pt lin); = Fillet Lines As Drawn
  (setvar 'filletrad 0); just in case
  (while (setq pt (getpoint "\nStart point of Line: "))
    (command "_.line" pt pause "")
    (if lin ; previous Line drawn?
      (command "_.fillet" lin (setq lin (entlast)))
      (setq lin (entlast)); else [first Line]
    ); if
  ); while
  (princ)
); defun

Kent Cooper, AIA
0 Likes
Message 5 of 6

Anonymous
Not applicable

Perfect, thank you very much 😉

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
Thanks, I can try this, but I think it will get confused where lines are close to one another, but iterations down the road and connect close lines that shouldn't be connected.

.... Your suggestion, whilst helpful, I think will make the 'fuzz' connect other bits first...
....

Not really, since PEDIT with the Multiple option uses only the selected objects, and the routine can control that by building a selection set of only the Lines that are drawn within it.  Again, in pretty simple terms:

 

(defun C:PJL (/ lines pt1 dists pt2); = Pedit-Join Lines
  (setvar 'filletrad 0)
  (setvar 'plinewid 0)
  (setvar 'peditaccept 1)
  (setq lines (ssadd)); start empty selection set
  (while (setq pt1 (getpoint "\nStart point of Line: "))
    (if pt2 ; only after first Line
      (setq dists (cons (distance pt2 pt1) dists)); then
    ); if
    (command "_.line" pt1 (setq pt2 (getpoint pt1 "\nEnd of Line: ")) "")
    (ssadd (entlast) lines); put it in the selection set
  ); while
  (command "_.pedit" "_multiple" lines "" "_join" (* (apply 'max dists) 1.1))
  (princ)
); defun

 

If you go around the perimeter of a building or room, it even closes the starting corner for you, if the open distance there is no more than 10% greater than the biggest open distance between other sequential Lines.

 

I can imagine some wacky configurations in which it might join things in a way you don't intend, if the gaps are too much greater than the lengths of the Lines and it follows too convoluted a route, but I wouldn't think that would be a problem in most ordinary situations.

Kent Cooper, AIA
0 Likes