;;; by Michael Puckett (defun cdrs (key lst / pair rtn) (while (setq pair (assoc key lst)) (setq lst (cdr (member pair lst)) rtn (cons (cdr pair) rtn) ) ) ;; (reverse rtn) RTN )
(defun Oarea (x) (vla-get-area (vlax-ename->vla-object x)) )
;;; For test only (vl-load-com) (defun C:AreaQ () (setq ee (entsel "\n请选取外框: ") ee (car ee) pts (cdrs 10 (entget ee)) ss (ssget "WP" pts) )
(print (- (Oarea ee) ;; (apply '+ (mapcar 'Oarea (sslist ss))) (apply '+ (mapcar 'Oarea (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) ) ) (princ) )
================================= ;; 依所附文件 删去半圆调试
Command: areaq
请选取外框: 90300.0
---------------------
请先用 Pedit 处理闭合
|