Author Topic: add vertex in 3d polyline with distance  (Read 797 times)

0 Members and 1 Guest are viewing this topic.

reyas1123

  • Newt
  • Posts: 40
add vertex in 3d polyline with distance
« 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


ahsattarian

  • Newt
  • Posts: 77
Re: add vertex in 3d polyline with distance
« Reply #1 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. )





mhupp

  • Newt
  • Posts: 33
Re: add vertex in 3d polyline with distance
« Reply #2 on: July 28, 2021, 08:20:58 AM »