乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: mrharris78

[编程交流] Lisp: Put all XREFs on layer "

[复制链接]

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 07:31:13 | 显示全部楼层
 
Here is what I have read lately about the same theme that you asking about pBe .
 
Interesting thread . http://www.theswamp.org/index.php?topic=38612.msg437172#msg437172
 
Tharwat
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2022-7-6 07:35:07 | 显示全部楼层
 
Thank you for the link Tharwat.
 
Guess the short answer is NO. or maybe NOT YET or even NEVER.
They probably have a good reason for that.
 
I'll investigate further
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 07:37:56 | 显示全部楼层
Agreed .
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:39:05 | 显示全部楼层
 
Cheers!
 
 
Tharwat has already shown you another great example, courtesy of Lee. :wink:
 
To add a bit more to the explanation, here's some additional documentation on SSGET:
 
 
As the "X" option searches the entire drawing database, you must utilize the filter to limit the included entity pointers in the selection set, or you must conditionally filter out what you do not want from the returned selection set... hope that makes sense.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:44:32 | 显示全部楼层
You might also want to consider using SSGET's "A" mode:
 
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:46:34 | 显示全部楼层
My version:
 
  1. (defun c:xrlayer ( / a b c d layer )      (setq layer "G-XREF")   (while (setq a (tblnext "BLOCK" (null a)))       (if (= 4 (logand 4 (cdr (assoc 70 a))))           (setq b (cons "," (cons (cdr (assoc 2 a)) b)))       )   )   (if (setq c           (ssget "_X"               (list                   (cons 0 "INSERT")                   (cons 2 (apply 'strcat (cdr b)))                   (cons 8 (strcat "~" layer))               )           )       )       (repeat (setq d (sslength c))           (entmod (list (cons -1 (ssname c (setq d (1- d)))) (cons 8 layer)))       )   )   (princ))
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2022-7-6 07:48:35 | 显示全部楼层
Interesting approach Lee, collecting locked layer names and using that for exclusion filter
 
Clever
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2022-7-6 07:52:20 | 显示全部楼层
 
 
Thanks for the info Renderman.
 
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:54:55 | 显示全部楼层
 
Thanks pBe, I assume you are referring to my example at theSwamp
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2022-7-6 08:00:18 | 显示全部楼层
Yup.. your new code here used a different approach. Block names.
 
Nice
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 10:20 , Processed in 0.572962 second(s), 70 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表