明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 208|回复: 4

帮我修改下代码

[复制链接]
发表于 2024-4-20 11:25 | 显示全部楼层 |阅读模式
50明经币
以下是是论坛,下载的代码,目前是切换图层厚,颜色,线型都随层了,我想改成颜色随层,线型不随层怎么改呢?或者改成都不随层也可以,拜托各位




  (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" "" ) )
发表于 2024-4-20 11:25 | 显示全部楼层
(command "chprop" ss ""        "la" cm  "c" "bylayer" "lt"        "bylayer" "" )) 试试改为 (command "chprop" ss ""        "la" cm  "c" "bylayer"  "" ) )
回复

使用道具 举报

发表于 2024-4-21 00:36 | 显示全部楼层
说明一下在什么平台上使用。
回复

使用道具 举报

发表于 2024-4-21 06:20 来自手机 | 显示全部楼层
qazxswk 发表于 2024-4-21 00:36
说明一下在什么平台上使用。

. 默认AutoCAD,哈哈,有点子故事。
回复

使用道具 举报

 楼主| 发表于 2024-4-21 12:30 | 显示全部楼层
start4444 发表于 2024-4-20 11:25
(command "chprop" ss ""        "la" cm  "c" "bylayer" "lt"        "bylayer" "" )) 试试改为 (command  ...

谢谢大师傅
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-6 02:07 , Processed in 0.273807 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表