[求助]查询面积总和
在规划图查询面积时,怎样做到选择多个对象,可以查询出面积总和,麻烦高手帮我编个lisp程序 (defun c:am (/ olderr oldcmdecho errexit undox restore ss1 nr en tot_area)<BR>(defun errexit (s)<BR>(restore)<BR>)(defun undox ()<BR>(command "._undo" "_E")<BR>(setvar "cmdecho" oldcmdecho)<BR>(setq *error* olderr)<BR>(princ)<BR>)
(setq olderr *error*<BR>restore undox<BR>*error* errexit<BR>)<BR>(setq oldcmdecho (getvar "cmdecho"))<BR>(setvar "cmdecho" 0)<BR>(command "._UNDO" "_BE")<BR>(if (setq ss1 (ssget '((-4 . "<OR")<BR>(0 . "POLYLINE")<BR>(0 . "LWPOLYLINE")<BR>(0 . "CIRCLE")<BR>(0 . "ELLIPSE")<BR>(0 . "SPLINE")<BR>(0 . "REGION")<BR>(-4 . "OR>")<BR>)<BR>)<BR>)<BR>(progn<BR>(setq nr 0)<BR>(setq tot_area 0.0)<BR>(setq en (ssname ss1 nr))<BR>(while en<BR>(command "._area" "_O" en)<BR>(setq tot_area (+ tot_area (getvar "area")))<BR>(setq nr (1+ nr))<BR>(setq en (ssname ss1 nr))<BR>)<BR>(princ "\n面积之和 = ")<BR>(princ tot_area)<BR>)<BR>)<BR>(restore)<BR>) 本帖最后由 作者 于 2008-8-14 19:08:40 编辑 <br /><br /> <p>解决这个问题这个东东不错: CAD图的长度 面积总和 成千上万个CAD图元都不在话下,结果列表显示,并可同时导出到excel当中.<br/>详细介绍<br/><a href="http://blog.sina.com.cn/s/reader_4837c5df0100abji.html">http://blog.sina.com.cn/s/reader_4837c5df0100abji.html</a></p><p></p> 你这个算量小巧手没用啊
页:
[1]