谁有求面积的lisp小程序撒
2个回答
展开全部
;从图中选取图元求其面积 by DnBc1
(defun c:qmj()
(vl-load-com)
(while (setq ent (car (entsel "\n请选取图元<回车退出>:")))
(setq obj (vlax-ename->vla-object ent)
mj (vl-catch-all-apply 'vla-get-area (list obj))
)
(if (vl-catch-all-error-p mj)
(progn
(princ "\n所选取的图元不具有面积属性!")
(alert "所选取的图元不具有面积属性!")
)
(progn
(princ (strcat "\n所选取图元的面积=" (rtos mj 2 3)))
(alert (strcat "所选取图元的面积=" (rtos mj 2 3)))
)
)
)
(princ)
)
(defun c:qmj()
(vl-load-com)
(while (setq ent (car (entsel "\n请选取图元<回车退出>:")))
(setq obj (vlax-ename->vla-object ent)
mj (vl-catch-all-apply 'vla-get-area (list obj))
)
(if (vl-catch-all-error-p mj)
(progn
(princ "\n所选取的图元不具有面积属性!")
(alert "所选取的图元不具有面积属性!")
)
(progn
(princ (strcat "\n所选取图元的面积=" (rtos mj 2 3)))
(alert (strcat "所选取图元的面积=" (rtos mj 2 3)))
)
)
)
(princ)
)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询