几何尺寸与公差论坛

 找回密码
 注册
查看: 754|回复: 0

【转帖】reload sheet forma

[复制链接]
发表于 2009-4-13 13:51:31 | 显示全部楼层 |阅读模式
reload sheet format
i'm just a beginner in macro writing. i'm writing a macro which will be used to replace an old sheet format/template with the new one. i'm using the function setupsheet4. the macro work fine and it changes the template size as desired but it doesn't changes the sheet format as per the selection or requirement. say for e.g. i have one a size drawing with an old sheet format and i want to change it to b size (b size template and b size sheet format). the macro will change the template size but not the sheet format. any idea how to fix this.
i have attached the macro. thanks for your concern.
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
answer hi deepak
here it is a modify version of your code.
i've find some "mistakes". in the setupsheet4 method you've put the scale to 0 for example. another thing at the beginning of all of your modules put the option explicit statement. this statement force you to declare all your variables (this is good practice). i've delete all the enumeration because if you go to tools/reference you'll see that you always reference the constant library so it's not necessary to redeclare them.
i've also rearrange your code and variables. in the module if you daclare your variable at the beginning of the module (outside of any sub) with the public statement, the variable is visible in all of your modules in the project.
that's all that i can think of.
if you've more question, feel free to ask.
hope this help
################################
stef
designer / cad administrator
sw 2007 sp5 winxp pro sp2
thanks a lot stef. it working perfectly now. i was messing it with last evening but all in vain. thanks for making my day.
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 09:22 , Processed in 0.035674 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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