我想应该这样做:
- ; (GetMass (vlax-ename->vla-object (car (entsel))) '(("ByLayer" 0) ("ByBlock" 0) ("Glass" 5) ("Concrete" 20)("Global" 1)))
- (defun GetMass ( o L )
- (if (and (eq 'VLA-OBJECT (type o)) (vlax-property-available-p o 'Material)(vlax-property-available-p o 'Volume))
- (* (cond ( (cadr (assoc (vla-get-Material o) L)) ) (0)) (vla-get-Volume o))
- )
- ); defun GetMass
尽管您必须学习一些visual lisp和DCL(或者只使用LM:ListBox-如果您只对用户提示感到满意的话)。 |