TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: reyas1123 on November 15, 2017, 02:34:24 AM

Title: add vertex in 3d polyline with distance
Post by: reyas1123 on November 15, 2017, 02:34:24 AM
Hello Friends,

Just want to ask does anybody has a code for adding vertex in 3d polylines with distance of each verteces.


Thanks

Title: Re: add vertex in 3d polyline with distance
Post by: ahsattarian on July 28, 2021, 06:19:31 AM
Try this  :



Code - Auto/Visual Lisp: [Select]
  1. (defun c:a ()
  2.   (setq s1 (car (entsel "\n Select (S)Pline to Add Vertex : ")))
  3.   (setvar "osmode" 512)
  4.   (setq po1 (getpoint "\n Select Point on (S)Pline : "))
  5.   (command "point" po2)
  6.   (setq point (entlast))
  7.   (command "break" (list s1 po2) "f" po2 po2)
  8.   (setq s2 (entlast))
  9.   (setq ss (ssadd))
  10.   (setq s0 point)
  11.   (while s0
  12.     (cond ((not (member (strcase (cdr (assoc 0 (entget s0))) t) '("vertex" "seqend" "point"))) (ssadd s0 ss)))
  13.     (setq s0 (entnext s0))
  14.   )
  15.   (entdel point)
  16.   (command "join" s1 s2 ss "")
  17.   (princ)
  18. )




Title: Re: add vertex in 3d polyline with distance
Post by: mhupp on July 28, 2021, 08:20:58 AM
Use join after this command
https://autocadtips1.com/2011/09/24/autolisp-break-at-distance/