Batch Image Export of Configurations
Batch Image Export of Configurations
(OP)
Hi Folks,
I work on assemblies of automation systems where we generate configurations of the various "states" of the various axes.
As part of our design review process I often generate images from a single viewpoint of the assembly in various states, so we can "jog" through the process with management and other engineers, typically in a powerpoint presentation.
As we change the assembly, I often have to update my slides to reflect the latest version. What I presently do is switch to that configuration and take a screenshot (macro for the screenshot), then paste into my powerpoint. It's a pretty tedious process and I'd like to automate it somehow.
I'm looking for a method or technique where I can tell Solidworks to generate an image of each of my configurations at a given orientation, and save these images to a folder with incremented file names.
Is this something that's exclusively in the domain of VB scripting, or is there another tool or technique I could use to generate these images?
Thanks in advance!
I work on assemblies of automation systems where we generate configurations of the various "states" of the various axes.
As part of our design review process I often generate images from a single viewpoint of the assembly in various states, so we can "jog" through the process with management and other engineers, typically in a powerpoint presentation.
As we change the assembly, I often have to update my slides to reflect the latest version. What I presently do is switch to that configuration and take a screenshot (macro for the screenshot), then paste into my powerpoint. It's a pretty tedious process and I'd like to automate it somehow.
I'm looking for a method or technique where I can tell Solidworks to generate an image of each of my configurations at a given orientation, and save these images to a folder with incremented file names.
Is this something that's exclusively in the domain of VB scripting, or is there another tool or technique I could use to generate these images?
Thanks in advance!






RE: Batch Image Export of Configurations
hopefully that will help.
RE: Batch Image Export of Configurations
Deepak Gupta
CSWE, CSWP, CSDA
SW 2012 SP4.0 & 2013 PR1
Boxer's SolidWorks™ Blog
SolidWorks™ Rendering Contest
RE: Batch Image Export of Configurations
CODE -->
Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim vConfigNameArr As Variant Dim vConfigName As Variant Dim swConfig As SldWorks.Configuration Dim swConfMgr As SldWorks.ConfigurationManager Set swApp = CreateObject("SldWorks.Application") Set swModel = swApp.ActiveDoc Set swConfMgr = swModel.ConfigurationManager Set swConfig = swConfMgr.ActiveConfiguration vConfigNameArr = swModel.GetConfigurationNames For Each vConfigName In vConfigNameArr Set swConfig = swModel.GetConfigurationByName(vConfigName) swModel.SaveAs3 swConfig.Name & ".jpg", 0, 1 Next End SubDeepak Gupta
CSWE, CSWP, CSDA
SW 2012 SP4.0 & 2013 PR1
Boxer's SolidWorks™ Blog
SolidWorks™ Rendering Contest
RE: Batch Image Export of Configurations
Will try shortly and let you know how it goes.
This helps strengthen my resolve to go through the available tutorials on vb in Solidworks.
RE: Batch Image Export of Configurations
CODE --> VBa
Dim swApp As Object Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim vConfigNameArr As Variant Dim vConfigName As Variant Dim swConfig As SldWorks.Configuration Dim swConfMgr As SldWorks.ConfigurationManager Dim boolstatus As Boolean Set swApp = CreateObject("SldWorks.Application") Set swModel = swApp.ActiveDoc Set swConfMgr = swModel.ConfigurationManager Set swConfig = swConfMgr.ActiveConfiguration vConfigNameArr = swModel.GetConfigurationNames For Each vConfigName In vConfigNameArr Set swConfig = swModel.GetConfigurationByName(vConfigName) boolstatus = swModel.ShowConfiguration2(vConfigName) swModel.SaveAs3 swConfig.Name & ".jpg", 0, 1 Next End SubRE: Batch Image Export of Configurations
Deepak Gupta
CSWE, CSWP, CSDA
SW 2012 SP4.0 & 2013 PR1
Boxer's SolidWorks™ Blog
SolidWorks™ Rendering Contest