AnsweredAssumed Answered

Is it possible to set the configuration when adding a part to an assembly using a VBA macro?

Question asked by Peter McCourt on Mar 30, 2017
Latest reply on Mar 31, 2017 by Raghvendra Bhargava

I am trying to add multiple configurations of the same part to an assembly using a macro. Is this possible? The following will insert the part but only in the last saved configuration:

 

Set SwApp = Application.SldWorks

Set Exl = Excel.Application

 

SwApp.DocumentVisible False, swDocumentTypes_e.swDocPART

 

Set Part = SwApp.OpenDoc6(SLD_Path, 1, 0, "A", Longstatus, Longwarnings)

 

Set Part = SwApp.ActiveDoc

boolstatus = Part.AddComponent(SLD_Path, 0, 0, 0)

 

SwApp.DocumentVisible True, swDocumentTypes_e.swDocPART

 

End Sub

Outcomes