 - (vl-load-com)
- (defun c:BBM ()
- (setvar "cmdecho" 0)
- (if (setq pt (getpoint "\n选择封闭区域内部点: "))
- (progn
- (setq ent (entlast))
- (command "BOUNDARY" "_non" pt "")
- (if (not (equal ent (entlast)))
- (progn
- (setq boundary1 (entlast))
- (setq area1 (vlax-ename->vla-object boundary1))
- (setq area (vla-get-area area1))
- (entdel boundary1)
- (princ
- (strcat "\n面积为: " (rtos area 2 2) "mm^3")
- )
- )
- (alert "\n边界未闭合!")
- )
- )
- (alert "\n未选择点!")
- )
- (setvar "cmdecho" 1)
- (princ)
- )
|