本帖最后由 xyp1964 于 2014-6-5 08:20 编辑
- (defun c:tt ()
- (if (setq ss (ssget '((0 . "*line,arc,circle,ellipse"))))
- (progn
- (setq lst(xyp-ss2list ss)
- lst1 (mapcar 'xyp-CurveLength lst)
- lst2 (vl-remove-if '(lambda (x) (xyp-etype x "line")) lst)
- lst2 (mapcar '(lambda (x) (vla-get-area (vlax-ename->vla-object x))) lst2)
- text1 (strcat "总面积为: " (rtos (apply '+ lst2) 2 4))
- text2 (strcat "总长度为: " (rtos (apply '+ lst1) 2 4))
- )
- (xyp-Put-Cliptext (strcat text1 "\n" text2))
- (princ "\n")(princ text1)
- (princ "\n")(princ text2)
- )
- )
- (princ)
- )
|