像这样的?我猜你画的单位不是1或4。如上所述;有点多余,但我刚刚添加到您的代码中。
- (defun c:pres2a (du / iu)
- (setq iu (getvar 'insunits))
- (if
- (= iu (or 1 4))
- (progn
- (initget "i m")
- (if
- (= du nil)
- (setq du "i")
- )
- (setq du (getkword (strcat "\nIs the drawing imperial or metric [i/m] <" du "> : ")))
- (if
- (and
- (= du "i")
- (= iu 1)
- (not (tblsearch "LAYER" "FORMAT"))
- )
- (progn
- (Inch)
- (blkrem)
- (alert "\nblock cleaning complete")
- )
- (princ "\n*** Error *** Drawing unit not imperial, use metric option!")
- )
- (if
- (and
- (= du "m")
- (= iu 4)
- (not (tblsearch "LAYER" "FORMAT"))
- )
- (progn
- (metric)
- (blkrem)
- (alert "\nblock cleaning complete")
- )
- (princ "\n*** Error *** Drawing unit not metric, use imperial option!")
- )
- )
- (princ "\nYou silly goose, units must be inches or millimeters!")
- )
- (princ)
- )
|