这
- (defun c:Test (/ *error* w l cl)
- ;;--- Tharwat 14. May. 2013 ---;;
- (defun *error* (x)
- (if cl (setvar 'clayer cl))
- (princ "\n*Cancel*")
- )
- (setq w [color=red]1.0[/color] [color=royalblue]; Width Value[/color]
- l [color=red]"0"[/color] [color=royalblue] ; Layer Name[/color]
- )
- (if
- (and (if (or (eq (type w) 'INT)
- (eq (type w) 'REAL)
- )
- t
- (progn
- (alert "Width Value must be either INTER , REAL Number <!>")
- nil
- )
- )
- (if (tblsearch "LAYER" l)
- t
- (progn
- (alert "Layer name is not found in drawing <!>")
- nil
- )
- )
- )
- (progn
- (setq cl (getvar 'clayer))
- (setvar 'clayer l)
- (command "_.offset" "_Layer" "_Current" w "\" "\" "")
- (setvar 'clayer cl)
- )
- )
- (princ)
- )
|