本帖最后由 飞雪神光 于 2024-1-8 12:30 编辑
- (defun c:sx (/ lm-entmake-layer obj)
- (setvar "cmdecho" 0)
- (vl-load-com)
- (defun lm-entmake-layer(datalst)
- (mapcar'set '(tc co) datalst)
- (or co (setq co 256))
- (or tc (setq tc (getvar "clayer")))
- (entmake (list '(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord")(cons 2 tc)(cons 62 co)'(70 . 0)'(6 . "CONTINUOUS")))
- )
- (if(null(tblsearch "layer" "DGWT-REV"))
- (lm-entmake-layer (list "DGWT-REV" 4))
- )
- (command "pline" )
- (while (not (zerop (getvar "cmdactive"))) (command pause))
- (setq obj (Vlax-Ename->Vla-Object(entlast)))
- (vla-put-constantwidth obj 20)
- (vla-put-color obj 181 )
- (vla-put-layer obj "DGWT-REV" )
- (princ)
- )
- (defun c:sx (/ lm-entmake-layer obj)
- (setvar "cmdecho" 0)
- (vl-load-com)
- (if(null(tblsearch "layer" "DGWT-REV"))
- (command "_layer" "n" "DGWT-REV" "c" "4" "DGWT-REV" "")
- )
- (command "pline")
- (while (not (zerop (getvar "cmdactive"))) (command pause))
- (setq obj (Vlax-Ename->Vla-Object(entlast)))
- (vla-put-constantwidth obj 20)
- (vla-put-color obj 181 )
- (vla-put-layer obj "DGWT-REV" )
- (princ)
- )
|