乐筑天下

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

Rename Block on Insert?????

[复制链接]

71

主题

928

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1230
发表于 2005-3-15 12:19:50 | 显示全部楼层

OK, so the problem is that you are renaming a block in the drawing and then trying to insert THAT block at another scale...therein lies your problem. You need to:
1. Save your base block BA-SYMB to disk
2. When you go to insert it, get the scale and check if the block BA-SYMB- & SCALE is in the drawing.
3. If not, insert the block from the disk file, NOT ANY VERSION ALREADY IN THE DRAWING. If it already exists skip to 5
4. Run the block & layer rename routine. Now you will won't have the BA-SYMB in your drawing again, so the next time you insert from the FILE, your code to rename will work just fine.
5. Insert the block as desired.......
So if all goes well, and you've inserted your block at both 48 & 96 scales, your block table would show: "BA-SYMB-48" & "BA-SYMB-96" but there would be NO "BA-SYMB"
Does that makes sense?
Jeff
回复

使用道具 举报

71

主题

928

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1230
发表于 2005-3-15 21:56:18 | 显示全部楼层
Hey Jeff
Thanks again
I am not sure if you are following me exactly but almost.
If you look at the code that I posted, I think it pretty much explains it.
OK,
Insert block at 48, the layer names in that block become layernames-48
Insert that block again at 96, those layers become layernames-96
Now, I want to be able to freeze, turn off etc each layer without effecting other layers but that isn't happening.
I beleive it is due to the fact that after the second block is inserted, you need to redefine it, therefore all layers take the side of the last block insert.
Does that make better sense?
Thanks again
Mark
回复

使用道具 举报

71

主题

928

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1230
发表于 2005-3-16 06:58:06 | 显示全部楼层
Jeff,
I am trying this approach: User inserts first block to scale, let's say 48,
Macro is ran. The layers get made accordingly,all is working well.
The problem is when we insert another one, so I try moving the firsrt one into place and exploding it, then I insert the second one, run the macro. The layers (the way I want them) are not created.
If I delete the first block that is exploded, then the layers for the second one will be created (layername-xscalefactor) which is no good, I need both to work.
So, my conclusion is that there is objects in the exploded block that were exposed after the block was exploded that my code doesn't like
I've since added a condition:
  1. If blkref.objectname = "acblockreference" Then
  2. continue

Still, I am getting a type mismatch error.
Any ideas on that as well?
Thank you
Mark
回复

使用道具 举报

14

主题

194

帖子

5

银币

后起之秀

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

铜币
250
发表于 2005-3-16 11:00:29 | 显示全部楼层
Daron
That rename command may just do the trick!
Thank you
Mark
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-16 22:12 , Processed in 1.156187 second(s), 58 queries .

© 2020-2025 乐筑天下

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