Some New Macros to tangle with

Recently I posted some new SolidWorks macro at Lorono’s SolidWorks Resources which you would like to try and might find useful for your day to day use.

Here are brief details on the macros:

Send Email via SolidWorks : Macro to send email with assembly name in subject.

Save and Open as PDF:  Macro to save active file as PDF in the same location and open the created PDF file

Hide Show Note : Macro to hide or show note in the active drawing.

There are more useful macros and stuff at Lorono’s SolidWorks Resources and I’ll be adding more similar macro there, so keep watching.

Using Empty Views (Part 2: How to use them)

My articles on Empty Views in SolidWorks have been long in coming.  This is not due to the topic being complex or anything.  It’s just taken me that long to get around to this series.  (There’s been a lot of other stuff to talk about in the meantime, such as SolidWorks World 2009, something called a 3D mouse, and rants about this or that.) The Part 1 article in this series discussed how to make, place and size Empty Views.  Part 2 now discusses how to use them once they are created.

Use Empty Views as quick Zoom to selection locations

OK, let’s say that one empty view each represents the title block, revision block and drawing notes.  How does one quickly move about the drawing to view these areas?  There are several methods available in SolidWorks.  The following method is likely less common, but is perhaps quicker can more common methods.

First, assign a shortcut to Zoom to selection function.  Zoom to selection is found under View pulldown>Modify>Zoom to selection.

Zoom to selection location

To add the shortcut (for much quicker access to this function), goto Tools pulldown>Customize…>Keyboard tab> and then search for “zoom to selection”.  From there, simply add a keystroke as the shortcut for Zoom to selection and choose OK to save.

Now here is how to use this shortcut with Empty Views.  With the drawing open and with no views selected, look over in the FeatureManager.  Select any one of the Empty Views (or any view for that matter).

FeatureManager display of views

As this point, simply hit your shortcut keystroke for Zoom to selection.  The viewport will immediately zoom to the area identified by the Empty View.

Zoom to selection of empty view

Choose another view from the FeatureManager and hit your shortcut for Zoom to section again.  Each time, the viewport will immediately zoom to the area defined by the selected view.

Using Empty Views for PDF bookmarking

As an added bonus, any views created on the drawing (including Empty Views) will become bookmarks if you save that drawing as a PDF.  This adds greatly to the navigability of PDF files for everyone who uses them.  Within PDF Reader, the bookmarks will appear to the left (similar to the FeatureManager in SolidWorks).  Simply LMB click on the desired view, and PDF Reader will jump to that location.

There are some pitfalls with saving a drawing as PDF, so if your company is experiencing those, then it is not recommended that drawings be saved as PDF.  In those cases, print to PDF works better.  Unfortunately, bookmarks are not created when printing a drawing to PDF.

Conclusion

The one thing that frustrates me about SolidWorks Empty Views is that SolidWorks Corp reduced their functionality (as discussed in Part 2).  However, with a simple hack, they can be used as drawing bookmarks, to contain drawing notes,  and to add functionality to PDF files.  Additionally, they are always useful for containing sketches, as noted in Part 1 of this series.

New type of SaveAsPDF macro

SolidWorks is able to save drawings and current model views as a PDF format file.  SaveAsPDF with Folder SelectionThere’s been a lot of macros written over the years that cut the process of saving as PDF down to as few steps as possible. One of the long standing requests for this type of macro (and many similar types of macros) is to allow the user to pick the save location. Just uploaded is a macro (SaveAsPDF with Folder Selection) that does just this, and simplifies the location selection process for default folders. This new macro also uses more modern API techniques to save the file (using modelext::saveas instead of model::saveas4).

This macro does many things that previous macros haven’t.  While allowing the user to establish a default save location folder, it also provides automatic alternative choices when the default is not available.  Yet, even with all of these, the user can still override automated selection and pick a new location.  It does all of this without the use of VB6 forms.

As with other macros that do similar tasks, this will work best when assigned to a keyboard shortcut or a toolbar icon.   Also, as with all SolidWorks macros, there is a chance it will not work “out-of-the-box”.  This is normally due to the fact that SolidWorks updates core reference libraries with each release.  If errors are encountered, simply re-reference to the libraries that are available to allow the macro to function.  More information about that is available in this previous article.