明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2315|回复: 3

检查图层创建图层

[复制链接]
发表于 2005-6-10 13:52:00 | 显示全部楼层 |阅读模式
怎样用Lisp检查图中有没有某图层然后把某图元挪到该图层,或在没有该图层的情况下创建此图层然后再........
发表于 2005-6-10 14:40:00 | 显示全部楼层
;判断有没有aaa这个层 (defun test ( / ss)
(setq ss (ssget))
(if (/= (tblsearch "layer" "aaa") nil)
(command "change" ss "" "p" "la" "aaa" "")
(progn
(command "-layer" "n" "aaa" "")
(command "change" ss "" "p" "la" "aaa" "")
)
)
)
发表于 2005-6-10 15:59:00 | 显示全部楼层
简洁明了啊,如果搂住不熟悉符号表也可用选择集过滤 (defun test ( / ss)
(setq ss (ssget "x" '(8."aaa"))) (if (/= ss nil)
(command "change" ss "" "p" "la" "aaa" "")
(progn
(command "-layer" "n" "aaa" "")
(command "change" ss "" "p" "la" "aaa" "")
)
)
)
发表于 2024-3-2 15:09:06 | 显示全部楼层
新手学习,留个脚印。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-25 05:25 , Processed in 0.159061 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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