非VBA且不防弹
- ; return area of picked boundary LPS 02-2009
- (defun c:da (/ elname ip sqft sqyd acre)
- (setvar "cmdecho" 0)
- (setq elname (entlast)
- ip (getpoint "Pick internal point: ")
- )
- (command "boundary" ip "")
- (if (eq (entlast) elname)
- (alert "No boundary created!")
- (progn
- (setq ar (command "area" "o" "l"))
- (setq sqft (getvar "area")
- sqyd (/ sqft 9.0)
- acre (/ sqft 43560.0)
- )
- (alert
- (strcat "\n Square Feet = " (rtos sqft 2 2)
- "\n Square Yards = " (rtos sqyd 2 2)
- "\n Acres = " (rtos acre 2 3)
- "\n"
- )
- )
- (entdel (entlast))
- )
- )
- (setvar "cmdecho" 1)
- (princ)
- )
|