明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 584|回复: 7

[提问] 把所有图层放入到0层

[复制链接]
发表于 2024-9-2 11:32:32 | 显示全部楼层 |阅读模式
本帖最后由 惜惜2 于 2024-9-5 08:05 编辑

(DEFUN C:ASA ()
(command ".explode" ss "")
(if (= (getvar "cmdactive") 1) (ssget "x" ) (sssetfirst nil (ssget "x" )))
(princ)
)


我需要把块炸开以后全选放入0层,颜色以及线型线宽随层,全选以后提示未知命令  这个需要怎么改

 楼主| 发表于 2024-9-3 08:19:17 | 显示全部楼层
发表于 2024-9-2 18:22:58 | 显示全部楼层
  1. (defun C:A11()
  2. (vl-cmdf "qaflags" 1 "explode" (ssget "x") "" "qaflags" 0)
  3. (if (= (getvar "cmdactive") 0)
  4. (progn
  5. (vl-cmdf "change" (ssget "x") "" "p" "la" 0 "")
  6. (vl-cmdf "change" (ssget "x") "" "p" "c" "ByLayer" "")
  7. (vl-cmdf "change" (ssget "x") "" "p" "LT" "ByLayer" "")
  8. )
  9. )
  10. (princ)
  11. )


 楼主| 发表于 2024-9-2 17:10:30 | 显示全部楼层
qazxswk 发表于 2024-9-2 16:31
(defun C:11 ()
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)

我改成这个可以自动选了 ,颜色和线型随0层怎么改?
(defun C:A11 ()
(if (= (getvar "cmdactive") 1) (ssget "x" ) (sssetfirst nil (ssget "x" )))
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)
(if (= (getvar "cmdactive") 0)
(vl-cmdf "change" (ssget "x") "" "p" "la" 0 "")
)
(princ)
)
 楼主| 发表于 2024-9-2 17:01:33 | 显示全部楼层
qazxswk 发表于 2024-9-2 16:31
(defun C:11 ()
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)

不对啊  颜色和线宽不能随0层    还有我看我的代码是可以自动全选的  你这个需要手动框选对象
发表于 2024-9-2 16:31:38 | 显示全部楼层
(defun C:11 ()
(setq ss (ssget))
(vl-cmdf "qaflags" 1 "explode" ss "" "qaflags" 0)
(if (= (getvar "cmdactive") 0)
(vl-cmdf "change" (ssget "x") "" "p" "la" 0 "")
)
(princ)
)
发表于 2024-9-2 13:43:14 | 显示全部楼层
直接合并图层多好。

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

本版积分规则

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

GMT+8, 2024-11-25 09:28 , Processed in 0.172904 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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