Control the toolbar button (Enable or Disable)

Discussion in 'SolidWorks' started by Rickydee22, Oct 18, 2006.

  1. Rickydee22

    Rickydee22 Guest

    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!
     
    Rickydee22, Oct 18, 2006
    #1
  2. Rickydee22

    That70sTick Guest

    I have an addin construction example at
    <http://www.esoxrepublic.com/devtools/> ("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".
     
    That70sTick, Oct 19, 2006
    #2
  3. Rickydee22

    Rickydee22 Guest

    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.
     
    Rickydee22, Oct 20, 2006
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.