[hehoubin][hehoubin]哈维斯 13:25:41
我有个增加顶点的程序
想弄个删除指定的顶点的程序。高手们帮忙看看
(defun C:xv (/ EN OBJ  T  P)
(if (and (setq EN (entsel "\n选择多选线: "))
(setq EN (car EN))
(sssetfirst nil (ssadd EN))
(setq OBJ (vlax-ename->vla-object EN))
(or (= (vla-get-objectname OBJ) "AcDbPolyline")
(and (princ "\n所选的对象不是多段线。") nil)
)
)
(while (setq  T (getpoint "\n指定新顶点: "))
(setq  T (trans  T 1 0)
  P (vlax-curve-getclosestpointto OBJ  T))
(vlax-invoke
OBJ
'ADDVERTEX
(1+ (fix (vlax-curve-getparamatpoint OBJ  P)))
(list (car  T) (cadr  T))
)
)
)
(sssetfirst)
(princ)
) |