帮我修改下代码
以下是是论坛,下载的代码,目前是切换图层厚,颜色,线型都随层了,我想改成颜色随层,线型不随层怎么改呢?或者改成都不随层也可以,拜托各位(defun li-xjtc (cm ys xx / ss lts )
(setvar "cmdecho" 0)
(if (= (tblsearch "layer" cm) nil)
(entmake (list
'(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
'(70 . 0) ;图层状态
(cons 2 cm) ;图层名称
(cons 62 ys) ;图层颜色
(cons 6 xx) ;图层线型
)
)
)
(setq ss (ssget))
(if (= ss nil)
(setvar "clayer" cm)
(command "chprop" ss "" "la" cm"c" "bylayer" "lt" "bylayer" "" )
)
(princ)
)
;;;主程序
(defun c:1 (/)
(li-xjtc "0-XG-Layer01" 7 "continuous")
)
(defun c:2 (/)
(li-xjtc "0-XG-Layer02" 7 "continuous")
)
(defun c:3 (/)
(li-xjtc "0-XG-Layer03" 7 "continuous")
)
(Princ
)
(command "chprop" ss "" "la" cm"c" "bylayer" "lt" "bylayer" "" )) 试试改为 (command "chprop" ss "" "la" cm"c" "bylayer""" ) ) 说明一下在什么平台上使用。 qazxswk 发表于 2024-4-21 00:36
说明一下在什么平台上使用。
. 默认AutoCAD,哈哈,有点子故事。 start4444 发表于 2024-4-20 11:25
(command "chprop" ss "" "la" cm"c" "bylayer" "lt" "bylayer" "" )) 试试改为 (command...
谢谢大师傅
页:
[1]