- (defun c:tt ()
- (if (setq ss (ssget '((0 . "arc,circle,spline,*po*,region,*surface"))))
- (progn
- (setq i -1
- a 0
- )
- (while (setq e (ssname ss (setq i (1+ i))))
- (command "AREA" "o" e)
- (setq a (+ a (getvar 'AREA)))
- )
- (princ (strcat "\n总面积为: " (rtos a) " 平方毫米"))
- (princ (strcat "\n总面积为: " (rtos (* a 1e-6)) " 平方米"))
- )
- )
- (princ)
- )
|