- 积分
- 3641
- 明经币
- 个
- 注册时间
- 2022-11-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2022-11-27 17:08:51
|
显示全部楼层
defun c:QW ()
(setvar "clayer" "0")
)
;这个语句是一键返回0图层。
(if (not (tblsearch "Ltype" "center"))
(command "linetype" "l" "center" "acadiso.lin" "")
)
;检测图形中是否有线型center,如果没有则加载调入,有则忽略。
(if (not (tblsearch "Ltype" "PHANTOM"))
(command "linetype" "l" "PHANTOM" "acadiso.lin" "")
)
;检测图形中是否有线型PHANTOM,如果没有则加载调入,有则忽略。
(if (null (tblsearch "layer" "折弯线"))
(entmake (list'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord") '(6 . "PHANTOM") '(62 . 6) '(370 . 0) '(70 . 0) '(290 . 1) '(2 . "折弯线")))
;6组码【线型】,62组码【颜色】,370组码【线宽】,70组码【可见】,290组码【打印】,2组码【图层名称】
);autolisp建立图层
(if (null (tblsearch "layer" "1激光打标层"))
(entmake (list'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord") '(6 . "CENTER") '(62 . 2) '(370 . 0) '(70 . 0) '(290 . 1) '(2 . "1激光打标层")))
;6组码【线型】,62组码【颜色】,370组码【线宽】,70组码【可见】,290组码【打印】,2组码【图层名称】
);autolisp建立图层
(if (null (tblsearch "layer" "0"))
(entmake (list'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord") '(6 . "Continuous") '(62 . 7) '(370 . 0) '(70 . 0) '(290 . 1) '(2 . "0")))
;6组码【线型】,62组码【颜色】,370组码【线宽】,70组码【可见】,290组码【打印】,2组码【图层名称】
);autolisp建立图层
(defun c:G ()
(setvar "cmdecho" 0)
(command "_.chprop" (ssget) "" "C" "ByLayer" "LA" "折弯线" "LT" "ByLayer" "")
(princ)
)
(defun c:R ()
(setvar "cmdecho" 0)
(command "_.chprop" (ssget) "" "C" "ByLayer" "LA" "1激光打标层" "LT" "ByLayer" "")
(princ)
)
(defun c:Q ()
(setvar "cmdecho" 0)
(command "_.chprop" (ssget) "" "C" "ByLayer" "LA" "0" "LT" "ByLayer" "")
)
(princ"\n***原理是程序会自动首先检测图层***\n***折弯线和1激光打标层***\n***是否存在如果没有则新建生成没有的图层***\n***如果已有图层则忽略不新建***\n***注意*图形需炸开是散线*自己定义的使用命令不要与其它命令冲突**\n***使用命令Q键将所选图形归0层**\n***命令R键将所选图形归1激光打标层**\n***命令G键将所选图形归折弯线图层**\n***本程序由余木华制作***欢迎您的指导和斧正*请多指教!**")
(prin1) |
|