乐筑天下

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

[编程交流] Covert all blocks & blocks ins

[复制链接]

13

主题

57

帖子

45

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 17:26:56 | 显示全部楼层 |阅读模式
Have many blocks & blocks within blocks that we need to convert to '0' layer excluding other entity such as lines,circles,text,dimensions.....inside this blocks.
 
Google and found many lisp & but never one that convert only blocks.
 
Please assists.
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 17:36:04 | 显示全部楼层
What u mean convert block to 0?
 
Sent from my Lenovo PB1-770M using Tapatalk
回复

使用道具 举报

13

主题

57

帖子

45

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 17:42:17 | 显示全部楼层
 
Meaning change the blocks & only blocks & blocks within blocks to layer '0'
回复

使用道具 举报

10

主题

8258

帖子

8335

银币

初来乍到

Rank: 1

铜币
31
发表于 2022-7-5 17:50:17 | 显示全部楼层
OK...after one eliminates all geometry, all text and all dimensions what's left of a block?
 
Can you provide us with a copy of one of these mystery blocks?  An actual .dwg file not an image file.
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 17:51:13 | 显示全部楼层
U dont need kisp for that. Just filter selection
 
Sent from my Lenovo PB1-770M using Tapatalk
回复

使用道具 举报

0

主题

375

帖子

385

银币

限制会员

铜币
-7
发表于 2022-7-5 17:59:43 | 显示全部楼层
  1. (defun C:LAY0 ( / acdoc) (vl-load-com) (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for blk (vla-get-blocks acdoc)   (vlax-for obj blk   (if     (eq (vla-get-objectname obj) "AcDbBlockReference")     (vla-put-layer obj "0")     )   ) ) (vla-regen acdoc acAllViewports) (princ) )
回复

使用道具 举报

13

主题

57

帖子

45

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 18:05:11 | 显示全部楼层
 
Hi Remark. nothing particular regarding the blocks. The purpose is we need to delete some entity of some layers using a 'layer delete' lisp routine. Unfortunately some blocks are in that layer, which will get deleted until we can change them all to layer '0'
回复

使用道具 举报

13

主题

57

帖子

45

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 18:14:14 | 显示全部楼层
 
Unable to since there are may levels of blocks within blocks
回复

使用道具 举报

13

主题

57

帖子

45

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 18:15:59 | 显示全部楼层
 
hi Stefan. Tested on a small dwg & it works. WIll test on actual dwg soon. Feedback soon. thank again.
回复

使用道具 举报

0

主题

375

帖子

385

银币

限制会员

铜币
-7
发表于 2022-7-5 18:25:22 | 显示全部楼层
OK, great...
You might want to filter out Xrefs, Xref's blocks, dim definitions and more...
  1. (defun LAY0 ( / acdoc) (vl-load-com) (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for blk (vla-get-blocks acdoc)   (if     (and       (eq (vla-get-isxref blk) :vlax-false)       (not (wcmatch (vla-get-name blk) "*|*,`*[EADX]*"))     )     (vlax-for obj blk       (if         (eq (vla-get-objectname obj) "AcDbBlockReference")         (print (vla-get-name obj))       )     )   ) ) (vla-regen acdoc acAllViewports) (princ))
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-13 03:51 , Processed in 0.444647 second(s), 72 queries .

© 2020-2025 乐筑天下

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