Return of Ctopher’s Custom Material Database

ctopher custom materials for SOLIDWORKSCustom materials in SOLIDWORKS are important if you are using materials not included in the default set.  Around a decade ago, Chris Saller compiled a bunch of such custom materials from varies sources based on requests and submissions from many different people.  This list is informally known as Ctopher’s Custom Material Database, “ctopher” being Chris’ handle.

Various versions of this file have been available on now long-gone websites over the years.  Well, the material database is finally back and bigger (better) than ever!  Chris has complied a new version in SOLIDWORKS 2016.  This new version has many new materials.  The new database is now available directly on SolidWorks Legion in the File Downloads tab as Ctopher’s Custom Material Database.

There are two methods to point SOLIDWORKS to use a custom material database.  The easiest method is described on Ctopher’s Custom Material Database download page.  Below is a slightly more advanced method which should also work on networks.

To point SOLIDWORKS to make the materials in this database available:

1.To use, place custom_matls_091516_sw2016.sldmat file into an easily accessible folder, such as S:\SOLIDWORKS Shared File\Custom Materials.  The folder is your choice, based on your network and operational set up.

2.Start SOLIDWORKS.

3.Goto Tools>Options…>System Options>File Locations.  In the Show folders for dropdown, select Material Databases.

4.Select Add button.  Navigate to your chosen folder, such as S:\SOLIDWORKS Shared File\Custom Materials.

5.Select OK button.

6.Repeat for all instances of SOLIDWORKS within the network that need to access this database.

To use the custom materials:

1.Open any part file.

2.In the Feature Tree, right click on Materials and then select Edit Materials.  “Custom_matls_091516” folder will be on your material list.

4.Click on desired subfolder, such as Copper Alloys.

5.Click on desired material to view properties.

6.Click on Apply to apply that material to your part.

7.Click on Close to return to your part.

Ctopher’s Custom Material Database

New Area on Lorono’s SolidWorks Resources

Recently, a new file area on the Lorono’s SolidWorks Resources has been created, called Engineering and Design.  The purpose of this new area is to provide some general engineering and design reference materials.  These materials are not necessarily related to SolidWorks itself, but useful to its users (and really anyone in the mechanical engineering field).  This new area will be expanded rapidly over the course of this month to include files that provide organized tables and functional calculations regarding on wire gages, positional tolerancing, sheet metal tolerance, thread sizes, metal coating and finishes, etc.

If there are tables, calculation spreadsheets or other data compilations you would like added to this area, please feel free to contact me with your files so that they may be included.  (I will not put up copyrighted material, like images of charts made by this or that publisher, without permission from the author.  However, data itself will be welcomed, preferably within an excel file.)

Also, comment here if you have any particular requests for this or any file area.

Getting Errors when using downloaded Macros?

Errors when running downloaded SolidWorks macros (Visual Basic 6) can be caused by many different issues, depending on the macro and which version of SolidWorks being used.  Here are some general points that may help.

Reference Libraries
Check reference libraries associated with the macro. These can be accessed by opening the macro through SolidWorks API editor (edit macro function), then going to pulldown Tools>Reference Libraries. If any of the listed libraries have the word MISSING in front of them, remove their check mark. You may need to replace it with a similarly named reference library that is included on your system. For example, if “SolidWorks 2008 Object Library” is missing and you are running SolidWorks 2007, then look for and activate the library named something like “SolidWorks 2007 Object Library”. SolidWorks may be able to do this automatically, but on many computer systems, you will need to manually make this edit, particularly if using a macro made on a version of SolidWorks newer than you are using.

Conversely, errors can be caused by having conflicting libraries loaded at the same time (i.e., having too many libraries).  No errors will appear in the reference library list.  If you are certain the correct library is loaded already, trying removing other SolidWorks related libraries one by one until the issue is resolved.

Also, the correct reference library may not be loaded at all. Research the line of code causing the error to make sure the correct reference library is loaded to support those instructions.

Additionally, if a macro was made on a newer version of SolidWorks than what you are currently using, its instructions may not be supported at all on the system running the older version of SolidWorks. In this case, you will need to find an equivalent API method for the older SolidWorks version, if one exists.

If the macro does not use Forms, a quick way to make sure you are using current reference libraries is to simply cut and paste the complete code from the existing macro file to a new one created fresh on your system. Often, this will fix any mismatched reference libraries, but it might still require research to make sure all the necessary reference libraries are loaded for that macro.

Sub-Modules
When executing the macro, make sure you specify the “Main” sub-module as the starting point. This is the section of code following the line “Sub Main ()”. Most macros are set up with Main as their starting sub-module. This is usually a fix if you are having issues associating your macro with an icon on a Toolbar, assigning a shortcut key, or trying to execute the macro from within another macro.

If the macro does not have a Main sub-module, then you may need to study the macro to discover which sub-module is meant as the starting point.

Copying code from online or plain text source
Sometimes when code appears in plain text, such as in a .txt file or from a forum online, it may not be formatted properly. Some of the lines may be too long for the plain text source, so they are line broken. This will disrupt the code, as SolidWorks API will misunderstand the instructions. When copy and pasting code from a plain text source, make sure to go over the code to insure all the lines are properly reconstructed by removing erroneous line breaks.

Sources for help
If issues are still occuring, contact the author(s), if available. Also, make sure to read over the material and examples provided in the SolidWorks API Help file included with SolidWorks. If those do not completely solve the issue, then search over various online forums dedicated to SolidWorks and SolidWorks API support. Many of these forums are listed under Forum Links.  If the search doesn’t resolve the issue, then post a question on those forums detailing the issue and requesting help from other SolidWorks users. You may also contact your VAR, as the issue you are having may actually be a bug or known issue in the SolidWorks API system itself.