<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982798#M65749</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... One thing I'd add is an undo begin/end. ...&lt;SPAN style="font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, and *error* handling to ensure the changed System Variable gets reset, and if the OP wants, a request to the User for the interval.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 19:08:47 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2021-01-06T19:08:47Z</dc:date>
    <item>
      <title>Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9978821#M65737</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wondering if someone could help out getting Vertices inserted into multiple polylines (simultaneously) at a specified interval. It must work with arcs as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've searched the web and I've found the following LISP, which works fine but only selects 1 object at a time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(defun c:demo ( / add_vtx pl int in pt flag )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(vl-load-com)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(defun add_vtx ( obj add_pt ent_name / bulg )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vla-addVertex&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(1+ (fix add_pt))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vlax-make-variant&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vlax-safearray-fill&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vlax-make-safearray vlax-vbdouble (cons 0 1))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(list&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(car (trans (vlax-curve-getpointatparam obj add_pt) 0 ent_name))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(cadr (trans (vlax-curve-getpointatparam obj add_pt) 0 ent_name))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq bulg (vla-GetBulge obj (fix add_pt)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vla-SetBulge obj&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(fix add_pt)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(sin (/ (* 4 (atan bulg) (- add_pt (fix add_pt))) 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(cos (/ (* 4 (atan bulg) (- add_pt (fix add_pt))) 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vla-SetBulge obj&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(1+ (fix add_pt))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(sin (/ (* 4 (atan bulg) (- (1+ (fix add_pt)) add_pt)) 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(cos (/ (* 4 (atan bulg) (- (1+ (fix add_pt)) add_pt)) 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vla-update obj)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq pl (car (entsel "\nSelect pline entity")))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(if (not (wcmatch (cdr (assoc 0 (entget pl))) "*POLYLINE"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(progn&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(alert "\nPicked entity isn't polyline - quitting")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(exit)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(if (and (or (eq (cdr (assoc 70 (entget pl))) 0) (eq (cdr (assoc 70 (entget pl))) 1)) (eq (cdr (assoc 0 (entget pl))) "POLYLINE"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(progn&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq flag T)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(command "_.convertpoly" "l" pl "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(if (not (eq (cdr (assoc 0 (entget pl))) "LWPOLYLINE"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(progn&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(alert "\nYou picked 3d polyline - quitting")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(exit)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq int (getdist "\nEnter Interval: "))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq in int)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(while (setq pt (vlax-curve-getPointAtDist pl int))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(add_vtx (vlax-ename-&amp;gt;vla-object pl) (vlax-curve-getparamatpoint pl (vlax-curve-getclosestpointto pl pt)) pl)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq int (+ int in))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(if flag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(command "_.convertpoly" "h" pl "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(princ)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 11:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9978821#M65737</guid>
      <dc:creator>Tiago.CaldeiraPZ4FE</dc:creator>
      <dc:date>2021-01-05T11:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9978896#M65738</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8920275"&gt;@Tiago.CaldeiraPZ4FE&lt;/a&gt;&amp;nbsp;, will be the interval the same for all polylines. ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible, upload your sample.dwg&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 12:17:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9978896#M65738</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2021-01-05T12:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979004#M65739</link>
      <description>&lt;P&gt;Hi there &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/58962"&gt;@devitg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, the interval would be applicable to all polylines selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The purpose is to convert these lines to Civil 3D feature lines and have no need to insert elevation points afterwards. Besides, civil 3d only allows for editing one feature line at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Posted LISP works fine with arc / curves. It only needs to fix the selection to be multiple object.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 13:02:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979004#M65739</guid>
      <dc:creator>Tiago.CaldeiraPZ4FE</dc:creator>
      <dc:date>2021-01-05T13:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979099#M65740</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8920275"&gt;@Tiago.CaldeiraPZ4FE&lt;/a&gt;&amp;nbsp; please upload your sample dwg , and state the step/polylenght&amp;nbsp; ratio&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 13:39:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979099#M65740</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2021-01-05T13:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979209#M65741</link>
      <description>&lt;P&gt;Sample drawing provided as attachment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The desired incremental step would be 5m.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 14:12:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979209#M65741</guid>
      <dc:creator>Tiago.CaldeiraPZ4FE</dc:creator>
      <dc:date>2021-01-05T14:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979327#M65742</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8920275"&gt;@Tiago.CaldeiraPZ4FE&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;The desired incremental step would be 5m.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It seems to me this can be quite a bit simpler:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:AV5 ; = Add Vertices every 5 drawing units
  (/ peac pieces ss n pl)
  (setq peac (getvar 'peditaccept))
  (setvar 'peditaccept 1)
  (setq pieces (ssadd))
  (prompt "\nTo add vertices every 5 drawing units to Polyline(s), Line(s) and/or Arc(s),")
  (if (setq ss (ssget "_:L" '((0 . "LINE,ARC,*POLYLINE"))))
    (repeat (setq n (sslength ss)); then
      (setq pl (ssname ss (setq n (1- n))))
      (while (&amp;gt; (vlax-curve-getDistAtParam pl (vlax-curve-getEndParam pl)) 5)
        (command "_.break" pl "_non" (vlax-curve-getPointAtDist pl 5) "@")
        (ssadd pl pieces)
        (setq pl (entlast))
      ); while
      (ssadd (entlast) pieces); remainder at end
      (command "_.pedit" "_multiple" pieces "" "_join" 0 "")
    ); repeat
  ); if
  (setvar 'peditaccept peac)
  (princ)
); defun&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That has the 5-unit interval built in, but it could be made to ask the User for the interval.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 14:53:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979327#M65742</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-05T14:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979461#M65743</link>
      <description>&lt;P&gt;This looks fantastic !!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks mate. You helped me a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 15:34:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979461#M65743</guid>
      <dc:creator>Tiago.CaldeiraPZ4FE</dc:creator>
      <dc:date>2021-01-05T15:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979843#M65744</link>
      <description>&lt;P&gt;You're welcome.&amp;nbsp; It occurs to me that if any selected object is already no longer than 5 units, the 'pieces' variable will end up holding the last object in the drawing, whatever that is and whether or not it has any relation to the purpose, and it will [try to] PEDIT that, which might be acceptable if it's an appropriate kind of thing, but it could be something un-PEDITable and cause an error, or it could be a Line or Arc that was not among your selection and that you don't want turned into a Polyline.&amp;nbsp; The routine could be made to account for that possibility, if you need it to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your selection includes any Line(s)/Arc(s) that are no longer than 5 units, would you want them converted into Polylines even though no vertices will be added?&amp;nbsp; Or left as they are?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 17:35:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9979843#M65744</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-05T17:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982130#M65745</link>
      <description>&lt;P&gt;You can transform the code that you have find to this. Is more fast that using command break and pedit.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vl-load-com)
(defun add_vtx (obj add_pt ent_name / bulg)
  (vla-addVertex
    obj
    (1+ (fix add_pt))
    (vlax-make-variant
      (vlax-safearray-fill
        (vlax-make-safearray vlax-vbdouble (cons 0 1))
          (list
            (car (trans (vlax-curve-getpointatparam obj add_pt) 0 ent_name))
            (cadr (trans (vlax-curve-getpointatparam obj add_pt) 0 ent_name))
          )
      )
    )
  )
  (setq bulg (vla-GetBulge obj (fix add_pt)))
  (vla-SetBulge obj
    (fix add_pt)
    (/
      (sin (/ (* 4 (atan bulg) (- add_pt (fix add_pt))) 4))
      (cos (/ (* 4 (atan bulg) (- add_pt (fix add_pt))) 4))
    )
  )
  (vla-SetBulge obj
    (1+ (fix add_pt))
    (/
      (sin (/ (* 4 (atan bulg) (- (1+ (fix add_pt)) add_pt)) 4))
      (cos (/ (* 4 (atan bulg) (- (1+ (fix add_pt)) add_pt)) 4))
    )
  )
  (vla-update obj)
)
(defun c:AddVtx2Dist ( / js AcDoc Space interval n obj ename v_length)
  (princ "\nSelect pline entity.")
  (setq js (ssget '((0 . "LWPOLYLINE"))))
  (cond
    (js
      (setq
        AcDoc (vla-get-ActiveDocument (vlax-get-acad-object))
        Space
        (if (= 1 (getvar "CVPORT"))
          (vla-get-PaperSpace AcDoc)
          (vla-get-ModelSpace AcDoc)
        )
      )
      (initget 6)
      (setq interval (getdist "\nAdd vertex at every interval &amp;lt;1.0&amp;gt;?: "))
      (if (not interval) (setq interval 1.0))
      (repeat (setq n (sslength js))
        (setq
          obj (ssname js (setq n (1- n)))
          ename (vlax-ename-&amp;gt;vla-object obj)
          v_length 0.0
        )
        (while (&amp;lt; v_length (vlax-curve-getDistAtParam ename (vlax-curve-getEndParam ename)))
          (if (not (equal (fix (vlax-curve-getEndParam ename)) v_length 1E-13))
            (progn
              (add_vtx ename (vlax-curve-getParamAtDist ename v_length) obj)
              (setq v_length (+ interval v_length))
            )
            (setq v_length (+ interval v_length))
          )
        )
      )
    )
  )
  (prin1)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Jan 2021 15:03:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982130#M65745</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2021-01-06T15:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982135#M65746</link>
      <description>&lt;P&gt;You can transform the code that you have find to this. Is more fast that using command break and pedit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vl-load-com)
(defun add_vtx (obj add_pt ent_name / bulg)
  (vla-addVertex
    obj
    (1+ (fix add_pt))
    (vlax-make-variant
      (vlax-safearray-fill
        (vlax-make-safearray vlax-vbdouble (cons 0 1))
          (list
            (car (trans (vlax-curve-getpointatparam obj add_pt) 0 ent_name))
            (cadr (trans (vlax-curve-getpointatparam obj add_pt) 0 ent_name))
          )
      )
    )
  )
  (setq bulg (vla-GetBulge obj (fix add_pt)))
  (vla-SetBulge obj
    (fix add_pt)
    (/
      (sin (/ (* 4 (atan bulg) (- add_pt (fix add_pt))) 4))
      (cos (/ (* 4 (atan bulg) (- add_pt (fix add_pt))) 4))
    )
  )
  (vla-SetBulge obj
    (1+ (fix add_pt))
    (/
      (sin (/ (* 4 (atan bulg) (- (1+ (fix add_pt)) add_pt)) 4))
      (cos (/ (* 4 (atan bulg) (- (1+ (fix add_pt)) add_pt)) 4))
    )
  )
  (vla-update obj)
)
(defun c:AddVtx2Dist ( / js AcDoc Space interval n obj ename v_length)
  (princ "\nSelect pline entity.")
  (setq js (ssget '((0 . "LWPOLYLINE"))))
  (cond
    (js
      (setq
        AcDoc (vla-get-ActiveDocument (vlax-get-acad-object))
        Space
        (if (= 1 (getvar "CVPORT"))
          (vla-get-PaperSpace AcDoc)
          (vla-get-ModelSpace AcDoc)
        )
      )
      (initget 6)
      (setq interval (getdist "\nAdd vertex at every interval &amp;lt;1.0&amp;gt;?: "))
      (if (not interval) (setq interval 1.0))
      (repeat (setq n (sslength js))
        (setq
          obj (ssname js (setq n (1- n)))
          ename (vlax-ename-&amp;gt;vla-object obj)
          v_length 0.0
        )
        (while (&amp;lt; v_length (vlax-curve-getDistAtParam ename (vlax-curve-getEndParam ename)))
          (if (not (equal (fix (vlax-curve-getEndParam ename)) v_length 1E-13))
            (progn
              (add_vtx ename (vlax-curve-getParamAtDist ename v_length) obj)
              (setq v_length (+ interval v_length))
            )
            (setq v_length (+ interval v_length))
          )
        )
      )
    )
  )
  (prin1)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 15:04:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982135#M65746</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2021-01-06T15:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982525#M65747</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/524107"&gt;@CADaSchtroumpf&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You can transform the code that you have find to this. Is more fast that using command break and pedit.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, it's faster, if the few seconds matter.&amp;nbsp; I did the Break and Pedit version partly because it's so much simpler [not just shorter, but no need to worry about bulge factors, whether you're in Paper or Model Space, conversion to VLA objects, etc.), but there's another advantage.&amp;nbsp; If you have blips turned on as I normally do, you can &lt;EM&gt;watch&lt;/EM&gt; it do its thing [which is kind of fun], and you get &lt;EM&gt;visual confirmation&lt;/EM&gt;&amp;nbsp;that all the Polylines selected were, in fact, processed.&amp;nbsp; I can imagine using something with no such visual clue, and wondering whether anything actually happened, and whether it happened to all of them.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 17:11:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982525#M65747</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-06T17:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982718#M65748</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp; You already know my opinion about command calls&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt; but your code works fine and is short and sweet. One thing I'd add is an undo begin/end. If you have a large selection and made a mistake, you will need to undo as many times as your PEDIT command is called.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clinking_beer_mugs:"&gt;🍻&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*EDIT .. there are also a ton of routines &lt;A href="http://www.theswamp.org/index.php?topic=18720.0" target="_self"&gt;&lt;STRONG&gt;HERE&lt;/STRONG&gt;&lt;/A&gt; to add a vertex to a polyline. And a comprehensive list of polyline edit functions &lt;A href="http://www.theswamp.org/index.php?topic=51153.msg562819#msg562819" target="_self"&gt;&lt;STRONG&gt;HERE&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 18:48:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982718#M65748</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-01-06T18:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982798#M65749</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... One thing I'd add is an undo begin/end. ...&lt;SPAN style="font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, and *error* handling to ensure the changed System Variable gets reset, and if the OP wants, a request to the User for the interval.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 19:08:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982798#M65749</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-06T19:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Default AutoCAD - Add Vertices at Interval - Multiple Polylines Simultaneously</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982815#M65750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;.... One thing I'd add is an undo begin/end. ...&lt;SPAN style="font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, and *error* handling to ensure the changed System Variable gets reset, and if the OP wants, a request to the User for the interval.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For sure.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clinking_beer_mugs:"&gt;🍻&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 19:15:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/default-autocad-add-vertices-at-interval-multiple-polylines/m-p/9982815#M65750</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-01-06T19:15:40Z</dc:date>
    </item>
  </channel>
</rss>

