Macro to turn on and off add ins

Discussion in 'SolidWorks' started by IL_Bow_Man, Dec 1, 2005.

  1. IL_Bow_Man

    IL_Bow_Man Guest

    I would like to do a macro to turn on and shut off addins in my
    solidworks. Anybody have any ideas.
     
    IL_Bow_Man, Dec 1, 2005
    #1
  2. IL_Bow_Man

    That70sTick Guest

    How would this be any simpler than going to "Tools --> Addins"?
     
    That70sTick, Dec 1, 2005
    #2
  3. IL_Bow_Man

    SteveT Guest

    Um.. use the Solidwroks office toolbar?

    unless your referring to other addins that are on the office toolbar.

    Hope that helps
    SteveT.
     
    SteveT, Dec 1, 2005
    #3
  4. IL_Bow_Man

    Kvick Guest

    How about this one... Got it from NG bout two years back... cant
    remember from who....

    Just modify the path to your add-in DLL... works fine here.

    ---------------------------------

    Dim swApp As Object

    Dim RetVal As Long


    'Path to the add in DLL for your application
    Const strAddInPath As String = "C:\the_path_to_your_addin"

    Sub main()

    Set swApp = Application.SldWorks
    If Not swApp Is Nothing Then
    RetVal = swApp.LoadAddIn(strAddInPath) 'Load Add in
    If RetVal = 2 Then 'add in already loaded
    'Unload the add in
    swApp.UnloadAddIn strAddInPath
    End If
    End If
    Set swApp = Application.SldWorks
    End Sub
     
    Kvick, Dec 2, 2005
    #4
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.