像这样的?
- (defun c:Test (/ e c l o)
- ;;; Tharwat 16.01.2014 ;;
- (setq e (entlast)
- c (getvar 'cecolor)
- l (getvar 'clayer)
- )
- (command "_.-boundary" pause "")
- (if (and (not (eq (setq o (entlast)) e))
- (eq (cdr (assoc 0 (entget o))) "LWPOLYLINE")
- )
- (progn
- (if (not (tblsearch "LAYER" "color"))
- (command "_.-layer" "_m" "color" "" "")
- )
- (mapcar 'setvar '(cecolor clayer) '("BYLAYER" "color"))
- (command "_.-hatch" "_s" o "" "_p" "_Solid" "")
- (mapcar 'setvar '(cecolor clayer) (list c l))
- (entdel o)
- )
- )
- (princ)
- )
|