本帖最后由 gaics 于 2023-8-19 14:07 编辑
没啥问题。但是也不用这么繁琐的代码吧?
我自己是这样用的:
- (defun c:hh (/ en ly *error* err myerr)
- (defun myerr (msg)
- (setvar 'CLAYER ly)
- (setq *error* err)
- )
- (setq err *error* *error* myerr)
- (setvar 'CMDECHO 0)
- (setq ly (getvar 'CLAYER))
- (if (= (tblsearch "layer" "HAT") nil)
- (command "layer" "N" "HAT" "l" "Continuous" "HAT" "c" 8 "HAT" "")
- )
- (setvar 'CLAYER "HAT")
- (command "_.rectang" pause pause)
- (command "_.hatch" "ansi37" "1" "0" "L" "")
- (setvar 'CLAYER ly)
- (princ)
- )
|