几何尺寸与公差论坛

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

【转帖】how to grey out a customized macro button

[复制链接]
发表于 2009-4-12 18:36:00 | 显示全部楼层 |阅读模式
how to "grey out" a customized macro button
hi,
i have created a macro that i use to save a drawing file in a pdf format and i assigned it to a custom button on my toolbar.
i am interested in "greying out" the button so it only works when a drawing file is open and not a part or an assembly. is there any way to do this? that is, i don't want to be able to accdently click on the button when i am working on a part
it is possible, but pretty difficult, to gray out the button. i would recommend placing the button on some toolbar that is only visible when you are in a drawing. i would also advise to add code (if you haven't already) that checks what type of document is active at the beginning of the macro and to exit if the document is wrong...
if application.sldworks.activedocument.gettype <> swdocdrawing then exit sub
i'll get you eh steve, if it's the last thing i dooooo!
thanks josh,
that will work fine. i ended up writing
set swapp = createobject("sldworks.application")
set model = swapp.activedoc
if model.gettype <> swdocdrawing then
msgbox ("this can only be used in drawing files.")
exit sub
end if
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-22 17:33 , Processed in 0.034566 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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