lisp中如何获取多段线长度并返回
1个回答
展开全部
;量取直线、多段线、样条曲线、圆弧、圆、椭圆的长度
(defun c:cdcl()
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
(while (setq ent (car (entsel "\n选取多段线<回车结束>:")))
(setq dxf (entget ent)
nam (cdr (assoc 0 dxf))
)
(if (wcmatch nam "LINE,*POLYLINE,SPLINE,ARC,CIRCLE,ELLIPSE")
(progn
(command "_lengthen" ent "")
(setq cd (getvar "PERIMETER"))
(princ (strcat "\n所选取图元的长度为" (rtos cd 2 3)))
)
)
)
(setvar "cmdecho" cm)
(princ)
)
(defun c:cdcl()
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
(while (setq ent (car (entsel "\n选取多段线<回车结束>:")))
(setq dxf (entget ent)
nam (cdr (assoc 0 dxf))
)
(if (wcmatch nam "LINE,*POLYLINE,SPLINE,ARC,CIRCLE,ELLIPSE")
(progn
(command "_lengthen" ent "")
(setq cd (getvar "PERIMETER"))
(princ (strcat "\n所选取图元的长度为" (rtos cd 2 3)))
)
)
)
(setvar "cmdecho" cm)
(princ)
)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询