are there any way to continue the polyline after break?

are there any way to continue the polyline after break?

Anonymous
Not applicable
18,292 Views
7 Replies
Message 1 of 8

are there any way to continue the polyline after break?

Anonymous
Not applicable

I use polyline to draw a line with straight and curve sections. The command breaks but I want to continue the previous the polyline to draw the arc. If I start a new polyline command, I have to start from straight instead of arc, and joint to the old one, which would lead to more work. so I am looking for the method to continue a break polyline command. Thanks.

18,293 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

I need more information.  When you say after a break, do you mean you end the pline command and then decide to continue a pline from there? Please explain.

0 Likes
Message 3 of 8

cadffm
Consultant
Consultant

You can not "continue" a breaked command, breaked is breaked (but i don't know how it can break except the user leave the command.

 

I not really understand what your problem is with the start of the new(second) polyline before you use command join or pedit(with option join),

so you can start with a straight or an arc segment, it is your choice!?

What is your problem by this point, can you show(jpg/dwg) and explain it more in detail?

Start a second PL and after this join both together is the fastest way without programming.

 

 

Sebastian

0 Likes
Message 4 of 8

ВeekeeCZ
Consultant
Consultant

I can offer my version of PLContinue routine, one of my favorites. 

 

(vl-load-com)
;------------------------------------------------------------------------------------------------------------ ;------------------------------------------------------------------------------------------------------------ (defun c:PLContinue ( / *error* :getAveragePtOfSelectionPts adoc oVAR nVAR ss en pt wd el pte) (defun *error* (errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end")) (princ (strcat "\nError: " errmsg))) (vla-endundomark adoc) (mapcar 'setvar nVAR oVAR) (princ)) (defun :getAveragePtOfSelectionPts (enx / id en sum pts) (setq id (caar enx) pts (cond ((= id 1) (cdar (reverse (car enx)))) ((or (= id 2) (= id 3)) (mapcar 'cadr (cdadr enx))) ((= id 4) (mapcar 'cadr (cdddar enx))) ((setq en (cadar enx)) (list (vlax-curve-getPointAtDist en (* 0.5 (vlax-curve-getDistAtPoint en (vlax-curve-getEndPoint en))))))) sum '(0 0) num (length pts)) (foreach x pts (setq sum (mapcar '+ x sum))) (mapcar '/ sum (list num num))) ;-------- (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object)))) (setq oVAR (mapcar 'getvar (setq nVAR '(CMDECHO PEDITACCEPT CLAYER)))) (mapcar 'setvar '(CMDECHO PEDITACCEPT) '(1 1)) (if (and (setq ss (ssget "_:S" '((0 . "LWPOLYLINE,LINE,ARC")))) (= 1 (sslength ss)) (setq en (ssname ss 0) wd (cond ((= "LWPOLYLINE" (cdr (assoc 0 (entget en)))) (cdr (assoc 40 (entget en)))) (0.))) (setq pt (:getAveragePtOfSelectionPts (ssnamex ss 0))) (setq pt (vlax-curve-getClosestPointTo en pt)) (setq pt (if (> (vlax-curve-getDistAtPoint en pt) (* 0.5 (vlax-curve-getDistAtPoint en (setq pte (vlax-curve-getEndPoint en))))) (vlax-curve-getEndPoint en) (vlax-curve-getStartPoint en))) ) (progn (setvar 'CMDECHO 0) (if (ssget "_P" '((0 . "LINE,ARC"))) (progn (command "_.PEDIT" en "") (setq en (entlast)) (if (not (equal pte (vlax-curve-getEndPoint en) 1e-6)) (command "_.REVERSE" en "")) )) (setvar 'CLAYER (cdr (assoc 8 (entget en)))) (setq el (entlast)) (setvar 'CMDECHO 1) (command "_.PLINE" (trans pt 0 1)) (setvar 'CMDECHO 0) (command "_W" wd wd) (setvar 'CMDECHO 1) (while (> (getvar 'CMDACTIVE) 0) (command PAUSE)) (setvar 'CMDECHO 0) (if (/= el (entlast)) (command "_.JOIN" en (entlast) "")))) (*error* "end") )

 

 BTW At AUGI wishlist is this still one of top 30. Vote for it!!

Message 5 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

I use polyline to draw a line with straight and curve sections. The command breaks but I want to continue the previous the polyline to draw the arc. If I start a new polyline command, I have to start from straight instead of arc, and joint to the old one....


 

My version of such a routine is PolylineContinue.lsp with its PLC command, available >here<.  Some advantages over @ВeekeeCZ's PLContinue command [sorry]:  it works in any UCS; it knows the direction the end of the selected object is headed, so you can immediately go into the Arc option, and it heads out in the tangent-continuation direction just as if you were continuing in the original Pline command; after you've added at least one segment, the Close option takes it back to the other end of the original object, not to where you hooked on.

Kent Cooper, AIA
Message 6 of 8

ВeekeeCZ
Consultant
Consultant

@Kent1Cooper wrote:

My version of such a routine is PolylineContinue.lsp with its PLC command, available >here<.  Some advantages over @ВeekeeCZ's PLContinue command [sorry]:  it works in any UCS....


Well, didn't know about yours. Very comprehensive routine though! No wonder that is better that mine since is almost 10 times longer. And good feature is to close pl to original beginning.

Anyway, one thing I don't like... how you automatically rotate the UCS to WCS and back... I'm working almost always under UCS so this is disturbing to me. And I would say that my routine works in UCS quite well.

0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@ВeekeeCZ wrote:
.... Well, didn't know about yours. .... Anyway, one thing I don't like... how you automatically rotate the UCS to WCS and back... I'm working almost always under UCS so this is disturbing to me. And I would say that my routine works in UCS quite well.

Yours may work well in any UCS if the object selected is in the current one, but it didn't work [for me] when a selected Polyline was not -- it drew a Polyline continuing from the end, but drew it in the current UCS, so since it wasn't in the same plane as the original, it couldn't Join the new one to the original.  That's why mine changes the UCS when there's a difference that matters [it doesn't always] -- it needs to draw in the UCS of the object in order to join the new part to it.

 

Anyway, it's supposed to turn UCSFOLLOW off, so it won't jump to Plan view in a different UCS when it changes it, so I hope at least it's not disturbing in that way.

Kent Cooper, AIA
0 Likes
Message 8 of 8

ВeekeeCZ
Consultant
Consultant

You're right Kent, I'm working in one plane only, just different views. 

Yes, with UCSFOLLOW 0 it just rotates the crosshair. Still annoying if you don't need it, IMHO.

0 Likes