Control the toolbar button (Enable or Disable)

Hi all!!!
Someone can help me with toolbar? My problem is when i want to enable
or disable my button in my own toolbar, because i have created my own
add-in. And for example i want to disable a button when i open a part
or drawing. Someone know how i can do this?
P.S.: I already look at the example on solidworks web site.
Thanks for your help!
Reply to
Loading thread data ...
I have an addin construction example at ("Create SolidWorks addin from macro in VB6 "). The comments in the addin module include explanations of toolbar functionality.
You can grey-out a toolbar using the "ButtonEnableMethod" parameter of "AddToolbarCommand". Write a function that returns 0 if part or drawing and 1 for assembly, and call that function for the enable parameter..
You can also limit a toolbar's availability to certain document types using the "DocumentType" parameter of "AddToolbar4".
Reply to
Thank you for your answer but the function enabledifpart don't work in my DLL and i can't debbug it in VB or i don't know how. How can i see if the document in solidworks is part or any other document? With my menu all works very well, but my toolbar is more difficult. I see my toolbar but it's stay always active.
Reply to

Site Timeline

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.