swNSX

Version 1.45
Name and save SolidWorks drawing documents in a variety of formats based on user defined rules.

User Manual



What is swNSX?

swNSX provides a simple method for naming and saving SolidWorks Drawing Documents in a variety of formats based on specific, user customizable rules. With swNSX it is easy to implement and maintain standardized documentation requirements or procedures from within SolidWorks thus improving workflow. Currently, the following file formats are supported - SLDDRW, DWG, DXF, eDrawing, JPG, TIFF and PDF.

Installing swNSX

Copy swNSX.dll to any convenient folder, maybe [$SOLIDWORKS/macros/swNSX/]. In SolidWorks open swNSX.dll file as you would any other SolidWorks document. Alternatively, you can also drag and drop swNSX.dll from the Windows Explorer into SolidWorks. swNSX will be added to the [Tools] menu of SolidWorks and you can start the program by clicking it. All necessary registry entries will be made by SolidWorks on exiting it.

Disabling swNSX

You can disable swNSX at anytime through the [Tools]->[Add-ins...] menu in SolidWorks.

Uninstalling swNSX

Quit SolidWorks and delete the [swNSX.dll] file.

Compatibility

swNSX has been tested with SW 2003 thru SW 2005. NOTE: SW 2003 does not support saving as PDF files from within SolidWorks.

Operation

Clicking on the swNSX menu item will invoke the swNSX Main Window:
swNSX Main Window
Selecting the appropriate choices and pressing [GO!] will name and save the selected file type as determined by the Filename Format String in the directory selected in the directory selection window and if appropriate, the File Destination Directory. The "Select Sheets to Save" frame may not be enabled depending on the filetype selected as it may be incompatible to certain filetype selections.

All current swNSX settings are also saved by pressing [GO!]. These settings are used to determine the state of swNSX during its next invocation.

Any Filename Format string may be entered in the "Output Filename Format" box (see details below). Pressing "Enter" will save the string for future use, while pressing "Delete" will erase it. (This behaviour is similar to that of textboxes in the Microsoft Internet Explorer).

swNSX enables each filetype to have its own set of format strings enabling consistent naming of saved files.

Output Filename Format Specification

Output Filename Format specification is a text string that determines how the files are named. Each field ("token") in this string is delimited by a "|" (pipeline) character. How the field "tokens" are interpreted is determined by a specific set of rules.

While saving as a SLDDRW document, each token is used to obtain the Custom Property Value from the PART or ASSEMBLY document refered to in the active DRAWING sheet, first from the applicable configuration and if that value is empty, then from the document. If the Document CP also returns empty, then the token is copied out to the filename literally.

In case of other file types (DWG, DXF, eDrawing, JPG, TIFF and PDF), the token is used to obtain the Custom Property Value from the DRAWING document. If that is empty the token is copied out to the filename literally.

In addition the following tokens have the following meaning within the context of swNSX:

Token Description
DRWNAME, FILENAME The current DRAWING document name, if it is a new document, then this is empty.
SHEETNAME The current (active) sheet in the DRAWING document.
SHEETNUMBER, CURRENTSHEETNUMBER The current sheet number of a selected (includes "all") set of sheets.
TOTALSELSHEETS The total number of sheets in a selected (includes "all") set.
TOTALDOCSHEETS, TOTALDRWSHEETS The total number of sheets in the DRAWING document.
MODELFILENAMEWITHEXTN The PART or ASSEMBLY document name (with file extension) refered to in the active DRAWING document sheet.
MODELNAME, MODELFILENAME As above, but without the file extension.
DATE The current date in a YYYY-MM-DD format.
YEAR The current year in a YYYY format.
MONTH The current month in a MM format.
DAY The current date in a DD format.
TIME The current time in a HH_MM format. NOTE: Windows does not allow a ":" (colon) in a file or directory name specification.

Note that some values may have multiple tokens. MODELFILENAMEWITHEXTN, MODELFILENAME and MODELNAME only have significance while saving as SLDDRW files.

Using File Destination Directories

File Destination Directories enable saving documents in specific directories determined by the file type.

To use File Destination Directories, enable the radio button at the bottom left corner of the main swNSX window. The directories may be selected/ entered in the window displayed on right clicking and selecting the appropriate menu item on the directory selection window. (NOTE: the menu item is disabled if the radio button is not checked). The following window is displayed:

File Destination Directory Selection
If a full path specification (including drive) is specified, the files will be saved in that directory. Alternately, if a path fragment is entered, the destination is determined relative to the base directory selected in the main swNSX window. In the case of the latter, both "..\" and ".\" are permissible. This base directory is displayed at the top of the window.

Any non-existent relative directories are created while saving files. You may also create new directories by enabling the appropriate radio button in the File Destination Directories window and clicking [Done]. Directories with full path specification are expected to exist and are NOT created.

Remember that in every case, only files of the current selected type are saved.

The swNSX.FMT file

The swNSX.FMT is a text file that is located in the same directory as the swNSX.dll file. It is automatically generated and maintained by swNSX and contains any Output Filename Formats entered by the user. The file may be edited by any text editor such as the Windows NOTEPAD.

Limitations of swNSX

Terms and Definitions

File Destination Directory Directories to which files are saved may be determined by the file types. This ensures that specific files are always saved in the same directories. Both absolute and relative paths may be specified. Network paths are also supported in swNSX.
Output Filename Format These are strings that determine how the file name is constructed - with information from the SolidWorks Drawing Document, Custom Properties etc.

swNSX Version History

Version Date Remarks
1.00 22-Jul-2005
  • Initial Release
1.20 01-Aug-2005
  • File Destination Directories implemented.
  • Recursive creation of new directories.
1.35 02-Aug-2005
  • Now saves previously unsaved documents without cribbing.
  • Unloads old file and reloads renamed and saved SLDDRW file.
1.40 17-Aug-2005
  • First copies all Document CPs, then all Configuration CPs, overwriting any with the same CP Name.

EULA (End User Licence Agreement)


If you like swNSX, please support its development by clicking the [Make a Donation] button:

Copyright (C) 2005  Stephen Hanwright & Vinodh Kumar M.
| www.swCP3.com | info@swCP3.com | Document Version: 0.30 | Date: 11-Sep-2005 |