Possible to check if an add-in is enabled using API ?

Discussion in 'SolidWorks' started by SW Monkey, Jun 15, 2006.

  1. SW Monkey

    SW Monkey Guest

    I have a PDF macro that relys on the "Save As PDF" addin in SW 2005.
    If the user doesnt have the addin enabled, and runs the macro, it acts
    like it saves the PDF, but it doesnt generate the PDF.

    Is there a way to check if the addin is enabled, so I can give a
    warning message if it isnt?
     
    SW Monkey, Jun 15, 2006
    #1
  2. SW Monkey

    Heikki Leivo Guest

    Is there a way to check if the addin is enabled, so I can give a
    Refer to API help, the SldWorks::GetAddinObject() function. By calling it
    you can grab any addin object (and call it's methods, btw). If it returns
    nothing, the specified add-in is not loaded, obviously.

    Hope this helps!

    -h-
     
    Heikki Leivo, Jun 15, 2006
    #2
  3. SW Monkey

    SW Monkey Guest

    Any idea what thecall for SaveAsPDF addin is? I just want to make sure
    its loaded, otherwise the user wont know why the macro button didnt
    save a pdf.
     
    SW Monkey, Jun 15, 2006
    #3
  4. SW Monkey

    TOP Guest

    Wouldn't that be a filetype under saveas?

     
    TOP, Jun 15, 2006
    #4
  5. SW Monkey

    Heikki Leivo Guest

    Any idea what thecall for SaveAsPDF addin is? I just want to make sure
    Good question indeed - it is not an addin no more in SW2006, so it's hard
    for me to find it out. I assume, that one way to find it out could be
    following:

    - Open registry editor
    - Browse to HKEY_LOCAL_MACHINE\Software\SolidWorks\Add-Ins
    - Browse through add-in keys (named{xxxx.xxx..}) and find the one with
    correct Description value
    - Copy the addin key GUID to clipboard (long number in curly brackets)
    - Use the find tool in registry editor and try to find that key in
    HKEY_CLASSES_ROOT folder

    You should be able to find a folder with same key name, and under that a
    folder named ProgID. For example, the GUID for HarnessWorks dll seems to be
    {5D4259AC-8693-4423-88C4-14618B5E9151}, and the ProgID is
    HWorks.HarnessWorks.1, therefore the function call for that add-in would be

    Dim foo as Object
    set foo = swApp.GetAddinObject("HWorks.HarnessWorks.1")

    Hope this helps, sorry that I could not be more specific regarding PDF
    add-in!

    -h-
     
    Heikki Leivo, Jun 16, 2006
    #5
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.