本帖最后由 xyp1964 于 2025-1-23 21:43 编辑
- (defun c:tt ()
- "填充面积求和"
- (setq i -1
- a 0
- )
- (if (setq ss (ssget '((0 . "hatch"))))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq a1 (vl-catch-all-apply
- 'vla-get-area
- (list (setq ob (vlax-ename->vla-object s1)))
- )
- )
- (if (vl-catch-all-error-p a1)
- (vla-put-color ob "1")
- (setq a (+ a a1))
- )
- )
- )
- (princ "\n填充总面积 = ")
- (princ a)
- (princ)
- )
|