×
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

Atuo running a macro after a part has been saved

Atuo running a macro after a part has been saved

Atuo running a macro after a part has been saved

(OP)
I want to run a macro after a part has been saved to record the file name in a database. I've got the recording bit working fine I just need to get it to autorun.  I'd rather it ran from the standard save and saveas and not need a special save macro. Can anyone point me to some hints?

RE: Atuo running a macro after a part has been saved

You want an addin for this.

Event-triggered routines are best in an addin.  You can have a macro constantly running to catch events like a file save, but that takes resources and is prone to trouble.

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

RE: Atuo running a macro after a part has been saved

Add-in is a good idea.  However, you may not need an add-in.  You can create a macro that replaces the save function and set up a keystroke and/or toolbar icon for it.  It should save the file, then execute your DB editing code.  The advantage to doing it this way is that you will only save to the DB when intended, and not just every time someone changes a model and then blinks and saves it again.

 

Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group

RE: Atuo running a macro after a part has been saved

(OP)
Thanks for the help so far

Not used add-in before.  Is it easy, or even possible?

I did consider the macro button option but it will get missed a few times. I like to make these sort of thing completly invisible to the user rather than adding extra thing to do.  I don't mind updating the database often, its pretty solid.

RE: Atuo running a macro after a part has been saved

Making an addin will require that the program be compiled, so you will need to write it in VB (6 or .NET) or C.

You can migrate macros to full VB, then write added code for macro functinality.  I did a presentation on this once.  It is posted on my website.

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

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