- 积分
- 1980
- 明经币
- 个
- 注册时间
- 2015-2-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|

楼主 |
发表于 2025-1-22 19:34:27
|
显示全部楼层
;;你说得有道理,根据你的建议将程序修改如下:
;;计算各种表面、面域的面积和。设计 何勇
;;注意:绘图单位以毫米计。
(defun C:calmj(/ ss e ent)
(setq SS (ssget '((0 . "SPLINE,circle,ELLIPSE,LWPOLYLINE,POLYLINE,REGION,LOFTEDSURFACE,SURFACE,REVOLVEDSURFACE,EXTRUDEDSURFACE,PLANESURFACE,SWEPTSURFACE"))))
(setq are1 0)
(while ss
(setq
e (ssname ss 0)
ent (entget e)
ss (if (> (sslength ss) 1)
(ssdel e ss)
nil
)
)
(command "AREA" "e" e)
(setq are1 (+ are1 (getvar "AREA")))
);;end while
(princ (strcat "\n总面积为:" (rtos are1) "mm2"))
(princ (strcat "\n总面积为:" (rtos (/ are1 1000000.0)) "m2"))
(prin1)
)
;;欢迎各位朋友批评指正 |
|