ONE YEAR AND 196 POSTS!!!!
One year ago today, I started this blog in hopes to have reference for AutoCAD tips in case I forgot them. After one year, I have made 196 posts and every week more and more people come to this blog and hopefully find a few good tips. Thanks for making my blogging experience fun and may there be many more helpful posts!!!
Here is a simple routine that lets you pick up where you left off. You simply pick the end of an existing polyline, and this routine will let you pick more points (add more vertices) to that polyline. This routine continues even the properites as well…
Here’s how:
- SWPOLY <enter> to start
- Select a part of a polyline that is near its endpoint.
- You may need to specify what endpoint you want to continue from
- Click to place more vertices
(defun C:SWPOLY (/ dat c elst wid ename pend pt) (vl-load-com) (setvar "cmdecho" 0) (setq plw (getvar "plinewid")) (if (and (setq dat (entsel "\nSelect source polyline: ")) (wcmatch (cdadr (setq elst (entget (setq ename (car dat))))) "*POLYLINE*")) (progn (setq wid (cdr (assoc 40 elst))) (prompt (strcat "\nWidth is " (rtos wid))) (setq pend (osnap (cadr dat) "_end")) (setq pt (cond ((equal (vlax-curve-getstartpoint ename) pend 0.0001) (vlax-curve-getstartpoint ename)) ((equal (vlax-curve-getendpoint ename) pend 0.0001) (vlax-curve-getendpoint ename)) (t nil))) (if pt (setq p pt) (setq p (getpoint "\nSpecify start point: "))) (command "_.pline" p "_w" wid wid) (while (eq 1 (logand 1 (getvar "cmdactive"))) (command pause)) (if (and pt (wcmatch (cdadr (entget (entlast))) "*POLYLINE*")) (command "_.pedit" ename "_j" (entlast) "" ""))) (prompt "\nNot a polyline")) (if plw (setvar "plinewid" plw)) (setvar "cmdecho" 1) (princ)) (princ)
many thanks for this jewel, I cannot recall how many times I lost track of the polyline and have to start from the last point to join them later, great routine
Pingback: AutoLISP: Continue Line on Layer… | AutoCAD Tips
Hallo
I’m from Germany and want to test your Makro but it doesn’t work in a German AutoCAD
in Line 28 is the problem
(command “_.pedit” ename “j” (entlast) “” “”)))
it should be
(command “_.pedit” ename “_j” (entlast) “” “”)))
then it will go
Kind regards
Andrew
Thanks for the heads up Andrew. I adjusted the posted code to include your suggestion.
Thanks
~Greg
Wow that works great! Do you have a lsp that can add a vertex to the middle of a polyline? I know you can put your mouse on a grip and wait till Add Vertex shows up and hit “a” and it will add another vertex but it would be nice if you could click multiple points without having to wait.
Here is one that works well. Make sure that your mid point OSNAP is turned on or else it will apply it to the nearest point where you click.
Mean while, i will look for a more automated routine that lets you simply select the segment and then it will be applied. I think that is more along the lines of what you are looking for.
http://forums.augi.com/showthread.php?70574-Adding-a-vertex-to-a-polyline&p=777309&viewfull=1#post777309
~Greg
hi! sorry this is my first post, I wanted to know if you can add the command before joint to ask for radius, otherwise I need to go back and fill it with radius. Thank you very much
Hi. In AutoCad 2017, this lisp does not work. Maybe I’m doing something badly, but it creates a new polyline not continues. Could you tell what I’m doing wrong.
I tried this and yes it continues the line but it is still a separate line. It isn’t like Carlson and joins and continues. You still have to join the lines after. In Carlson the command lets you continue a line and then it closes to the original beginning point. Not the beginning of the line that you start with this command.
you have to Enter instead of Esc
Works perfectly. You have to hit “Enter” after command to register. Thank you so much.