I don’t work much with file export into various format but getting across a free OBJ export tool from Neil Larsen and macro-maker Karpena, I thought it might be good thing to spread across the SolidWorks community.
Neil Larsen has shared a free macro, suitable for SW2005 and up, to export your models in Alias|Wavefront .obj format complete with .mtl and textures. The macro works with parts and assemblies and configurations. It has been made to enable SolidWorks models to be rendered in cg applications such as Blender and Octane Render. As of the time of this post Blender 2.62 and Octane beta2.57 are current.
The macro can be can downloaded from here. It comes to you courtesy of karpena, who wrote the basis of the macro, and yours truly who extended it and gave it a UI. The zip contains the necessary files and instructions. Please be sure to read the README about the ins and outs of installing/using the macro. This macro won’t as a rule be supported but if there are teething issues with this release please report them here.
Neil does request everyone who so ever uses this macro,“All we ask, aside from not to sell it, is that you make sure any variants in the wild have some distinction in the name so that its clear which macro is for which apps and not confuse revisions. Its sort of in keeping with the spirit of open source because both Roman (karpena) and I make use of Blender.”
The SW macro can go anywhere but conveniently where you keep your other SW macros. You will need to use the provided toolbar button to launch the macro from SW. See the SW Help>Macros>Customize buttons to find out how to set this up. See also the included picture of the custom button showing to select the modSWtoOBJ.InitialUI as the ‘Method’ to start.
NOTE: The macro will not run from the menu Tools/Macro/Run> or from the toolbar Macro>Run.
The macro included was authored in SW2009. Different SW versions will require you to open the macro in the SW MS VBA window, reselect the Reference Libraries appropriate to that version, andthen save the macro. See the included ‘References’ picture of SW2009. Opening in another version may show the References as being ‘MISSING’. Look down the list and find equivalent entries but for the year of your SW install. Sometimes SW will find these references itself. The Blender helper script is required to load the finished .obj into Blender automatically.
It should work with Blender 2.5 and up. Make sure it goes in the same folder as the Blender.exe . The path to Blender is assumed to be C:\Program Files\Blender Foundation\Blender\blender.exe
The path to Octane is assumed to be C:\Program Files\Refractive Software\OctaneRender\Octane.exe
You can change these paths if necessary in the vba module code by going to lines 627 & 632 respectively.
Here is one example of OBJ export (you can find them in the zip file too).