明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1298|回复: 1

如何搜集一幅图中的块?

[复制链接]
发表于 2004-12-1 13:26:00 | 显示全部楼层 |阅读模式
一幅图中插入了很多小图块,这些小图块在其他图形中要经常用到,想偷懒一下(也许有一百多个),如何打开一幅图后,用一个程序将其中所有的块搜集到一个文件夹下面。


块名、块图形、插入基点、.....
发表于 2004-12-1 14:15:00 | 显示全部楼层
;from Barr Doug ;Re: Block to Wblock routine
;A short routine follows. Drawings go in same directory you're currently in.
;-doug

;"Jod" <jodwithay@c4.com> wrote in message
;news:C4B1C2C1406087ED3C4AB6340F78868D@in.WebX.maYIadrTaRb...
;> Does anyone out there have a routine that will take all of the blocks in a
;> drawing and wblock them to a file of the same name? Any help would be
;> appreciated. TIA.

(defun C:writeblk ()
(setvar "cmdecho" 1)
(setq dir (getvar "dwgprefix"))
(setq b (cdr (assoc 2 (tblnext "block" T))))
(while (= "*" (substr b 1 1))
(setq b (cdr (assoc 2 (tblnext "block"))))
)
(setq bs (substr b 1))
(setq bs (strcat dir bs))
(command "-wblock" bs b)
(setq count 1)
(while
(setq b (cdr (assoc 2 (tblnext "block"))))
(while (= "*" (substr b 1 1))
(setq b (cdr (assoc 2 (tblnext "block"))))
)
(setq bs (substr b 1))
(setq bs (strcat dir bs))
(command "-wblock" bs b)
(setq count (1+ count))
)
(setq count (rtos count 2 0))
(setq count (strcat count " .dwg files created from blocks. "))
(princ count)
(princ)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-30 04:31 , Processed in 0.142138 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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