×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SolidWorks API (Add-in vs. Stand-Alone App)

SolidWorks API (Add-in vs. Stand-Alone App)

SolidWorks API (Add-in vs. Stand-Alone App)

(OP)
Hi Folks,

This is a somewhat subjective question but I'm interested in hearing from some of the API junkies here.  My question is simple:

What are your feelings about coding and implementing a SolidWorks Add-in over a stand-alone application and vice versa?  When do you decide that going this route is better than using the macro approach?

I am doing a presentation about SolidWorks automation and have pretty well covered the topic of macros.  I want to put in a couple of slides about Add-ins and stand-alone programs that use the SolidWorks API just to make mention of these options but I've developed a case of writer's block.

Obvioulsy we can do quite a bit with macros but I have enough on that subject so if we could please stick to the question of when we DON'T use macros that would be great.

Thanks!

Chris Gervais
Application Engineer
CSWP, CSWST

RE: SolidWorks API (Add-in vs. Stand-Alone App)

For me...What Add-In's have over Macros and Stand-alone applications is that they are better for handling Events (like FileOpen, Delete, ClearSelection, ChangeSelection, etc...)

Macros and Stand-alone applications can handle events, but they require more setup and must be ran either manually or with a special SolidWorks startup routine. And if using macro's to do this, stability has been known to be an issue. Add-Ins on the other hand automatically load when starting SW, and are very stable.

Ken

RE: SolidWorks API (Add-in vs. Stand-Alone App)

Main advantages of addins:
[ul]
  • They load/startup with SW
  • You can add menus and toolbars
  • You can create property manager pages

  • [li]Monitoring for events is more robust (though technically still possible with macros and .exe's if they are running at the time).

    For either addins or stand-alone, compiled code runs faster.  I have not noticed a difference in speed between the two.

    RE: SolidWorks API (Add-in vs. Stand-Alone App)

    Stand alones will sometimes run slower than addins or macros because they do not directly connect to SolidWorks.  I forget all the technical stuff (I have it in an Email from SolidWorks).

    Regards,

    Regg

    RE: SolidWorks API (Add-in vs. Stand-Alone App)

    (OP)
    Yes, from a technical standpoint Add-ins and Stand-alone programs will perform differently.  An Add-in runs within the SolidWorks environment/process thus giving it better performance.  Stand-alones basically run in parallel and the API calls have to go through a translation process before getting fired off.

    Thanks for the input but it's not quite what I was after.  Let me try rephrasing the question differently.

    Can anyone give me examples where they were looking at programming some specific task and came to a decision that the best way to accomplish what they wanted to do was to go the Add-in/Stand-alone application route?

    Like I said in my initial post, I am looking for a little help on a presentation about the SolidWorks API.  The intended audience is going to consist primarily of novices.  What I really want to accomplish is to give people an idea about when/where/why people decide that a macro is not the way to go by citing some examples (real-world or hypothetical).

    Thanks,

    Chris Gervais
    Application Engineer
    CSWP, CSWST

    RE: SolidWorks API (Add-in vs. Stand-Alone App)

    Examples:
    1. Customer wanted toolbars
    2. Customer needed program to issue warning when certain drawing views were created (requires API events to monitor active doc type and view creation).
    3. Customer wanted external references report on screen whenever assembly or drawing opened (requires API events tom monitor when dwg or assembly opened).

    batHonesty may be the best policy, but insanity is a better defense.bat
    http://www.EsoxRepublic.com-SolidWorks API VB programming help

    RE: SolidWorks API (Add-in vs. Stand-Alone App)

    Things add-ins can do that standalone apps/macros can't:
    -accomdate event handlers i.e. when SW opens a document, do this
    -"integrate" the task you want to perform in to existing SolidWorks UI - i.e. property manager pages, menus

    Anything you can do in a standalone app/macro you can do in an Add-in, but a standalone app/macro is easier to develop.  You also need full VB (.Net or VB6) or C++ to develop an add-in or standalone app - you can develop a macro with SolidWorks VBA.

    RE: SolidWorks API (Add-in vs. Stand-Alone App)

    TheTick,

    I thought it was possible to create Property Manager Pages with macros? I'm pretty sure I saw an example somewhere.

    Ken

    RE: SolidWorks API (Add-in vs. Stand-Alone App)

    Ken,

    You remember correctly.
    I have the sample code around here somewhere.

    Remember...
           "If you don't use your head,            idea
                       your going to have to use your feet."

    Red Flag This Post

    Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

    Red Flag Submitted

    Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
    The Eng-Tips staff will check this out and take appropriate action.

    Reply To This Thread

    Posting in the Eng-Tips forums is a member-only feature.

    Click Here to join Eng-Tips and talk with other members!


    Resources