Setting Up and Troubleshooting Your SolidWorks Add-in Development Environment. Take off, eh…

June 12, 2008

 

Writing Add-ins in SolidWorks can be tricky stuff as it involves class libraries, COM, interfaces, etc…  It can be argued whether it is easier or harder in .NET (ease of use of .NET versus pain in the rear of COM Interop) but your good friends at SolidWorks set out to make it easy on all of us by creating Visual Studio templates for quickly creating SolidWorks Add-ins.  Read more

If you enjoyed this post, make sure you subscribe to my RSS feed!

Free SolidWorks Add-In To Remind You To Eat Your Custom Properties

February 23, 2008

 In spite of all their positive benefits, which are many, more than a few SolidWorks users look upon custom properties with the same disdain that a pre-schooler would have for green leafy vegetables.  You can explain the benefits of custom properties, how they help you find things, how they lead to healthy drawing title blocks, how they improve PDM implementations, etc… until you are blue in the face and with some individuals you still won’t make a dent.  There might be a change for a few days even a few weeks but inevitably you are back to files with no custom properties filled out. 

In order to increase the life-expectancy of CAD administrators everywhere, I have posted a free .NET Add-In for SolidWorks that will “remind” your users to enter certain custom properties whenever they create a new file or save an existing one (after the initial save).  The list of custom properties is configurable and

  Read more

If you enjoyed this post, make sure you subscribe to my RSS feed!

Macros 301 - Generate Document Numbers From MS Access Database And Auto Insert Them Into New Documents

February 9, 2008

Father forgive me.  It has been two weeks since my last blog post.  I apologize everyone for the long interval but things have been crazy.  In addition to some long nights at my day job, I am in the process of releasing a new version of InspectionXpert, the Quality Inspection Sheet generating software from my company Extensible CAD.  It is a rewarding endeavor but also very demanding.

 Anyways… not so long ago I posted a Macro & tutorial on how to register for SolidWorks events.  One application of that technique that I mentioned was to automatically generate document numbers for your SolidWorks document and insert them into SolidWorks “auto-magically.”  Well, not too long thereafter I was bombarded with emails asking me to post that little Macro and I promised to do so.  This post is the fullfillment of that promise.  I’m sorry it took so long but I think you guys will like it.  I feel it is “auto-magically delicious” myself : )

 You can download the database and the macro from here.

Keep reading to see a flash video of the macro in action…

Read more

If you enjoyed this post, make sure you subscribe to my RSS feed!

How To Destroy References To SolidWorks From Managed Code

December 20, 2007

 

Memory management in the COM world is a lot more straightforward in the COM world than it is in the .NET world.  Destroying COM references from .NET applications typically includes trial and error, calls to mysterious APIs, prayer and in the end, frustration.  It always reminds me of tying to kill a vampire, werewolf or some other bloodsucking, mythical creature that just won’t die.  It is because of this that my heart warmed with joy when I saw that some kind soul over at SolidWorks wrote a post to once and for all clarify how to destroy references to SolidWorks’  COM objects.

Tech Tip From SolidWorks On Destroying References To Unmanaged (i.e. COM) Components

 We have all heard about the promised land of .NET where you don’t have to worry about memory management.  The garbage collector handles all of the memory management for you.  You just instantiate your objects, use them and then forget them.  Santa Clause The .NET Garbage Collector determines when the objects are no longer needed and then destroys them and reallocates the memory.  Anyone who does API programming with SolidWorks in .NET either knows or should know that this is not the case for unmanaged (i.e.  COM) components (e.g. the SolidWorks class library used for interfacing with SolidWorks).  Some CAD systems (e.g. Unigraphics) have implemented a .NET API interface but SolidWorks still uses a COM  API interface.  This means that SolidWorks API developers using .NET must destroy SolidWorks objects “they d@mn self.” 

And remember…

…Even a man who is pure in heart
and says his prayers by night
may become a wolf when the wolfbane blooms
and the autumn moon is bright.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Macros 201 - How To Register Your SolidWorks Macro To Receive Notifications For SolidWorks Events

November 1, 2007

Why Should I Learn How To Register My Macros To Register For Notifications From SolidWorks? 

The common Macros that you see floating around the SolidWorks community are many and most of them are useful.  However, most of those Macros run only when explicitly commanded to do so by the user.  This is great for most Macros but there are times when it is nice to have some of your code run every time a certain event happens in SolidWorks.  For example, what if you want to have SolidWorks filenames determined based on your company’s part-numbering scheme, which is pulled from a database?  Wouldn’t it be nice to have the situation where every time SolidWorks prompts you to save a file, the filename box was pre-populated with the next number in the sequence? 

You might be thinking, why not just Read more

If you enjoyed this post, make sure you subscribe to my RSS feed!