小弟有一个增加多段线顶点的程序,求大侠帮忙增加出错函数,并能够在自定义坐标下使用,不胜感激
- ;增加多段线顶点
- (defun c:jdd(/ e pt)
- (setq e (entsel "\n选择多段线"))
- (setq pt (getpoint))
- (ls-addver (car e) (cadr e) pt)
- (princ)
- )
- ;25.a增加多段线顶点
- (defun ls-ADDVER (ENAME P pn / obj pp n newv)
- (if pn
- (progn
- (setq OBJ (vlax-ename->vla-object ENAME)
- PP (vlax-curve-getclosestpointto OBJ (trans P 1 0))
- N (fix (vlax-curve-getparamatpoint OBJ PP))
- PN (list (car PN) (cadr PN))
- NEWV (vlax-safearray-fill
- (vlax-make-safearray vlax-vbdouble '(0 . 1))
- PN
- )
- )
- (vla-addvertex OBJ (1+ N) NEWV)
- )
- )
- )
|