ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
JKJared Kleyn07/03/2025

I'm trying to write a Macro that when you select a part within an assembly you can run the Macro to toggle weather the part is excluded from the BOM in all configurations. This is the code that I have gotten so far.

Sub main()
'declare solidworks interface
Dim swApp As SldWorks.SldWorks
Set swApp = Application.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swModel = swApp.ActiveDoc

'error checking
If swModel