I have made a VBA program that lists properties for SW-files. I would also
like to show the value of the check-box "don't show child component in BOM
when used as a sub-assembly"
I use the following code
Dim swApp As SldWorks.SldWorks
Dim Model As ModelDoc2
Dim numConfigs As Long
Dim Names As Variant
Set swApp = CreateObject("sldWorks.application")
Set Model = swApp.OpenDoc6(path & filename, swDocASSEMBLY,
swOpenDocOptions_Silent, "", lngErrors, lngWarnings)
numConfigs = Model.GetConfigurationCount()
Names = Model.GetConfigurationNames()
For i = 0 To (numConfigs - 1)
MsgBox ("Config #" + Str(i) + " is: " + Names(i))
This lists the names of the different configurations - but I cant figure out
how to access the field "ShowChildComponentsInBOM" I looked at API help -
but it doesn't really help me on this one - so a specific example would be
as you can see, the APIs to access the properties require the config names.
There is a Configuration::Name method to obtain the name of a config.
If you want to go trhough all configs, then ModelDoc2::GetConfigurationNames
is the one.
My 2 cents if you want to do some serious API development : spend a few
hours reading ALL the apihelp. You can't memorize everything, but you'll
remember what's in and what's not.