I’m having some weird behavior that I’ve yet to figure out. I’m opening a drawing (*.slddrw) using the following piece of code shown below. For some reason, when I update the BOM, it removes every item in the BOM, where as if I open the same file using the file open from within SolidWorks, the BOM updates/refreshes fine. Any insight as to why this could be happening?
#Region " OPEN A SOLIDWORKS FILE THROUGH SOLIDWORKS "
Sub Open_SW_File(ByVal SW_File_Name As String, Optional ByVal SW_Config_Name As String = "")
Dim swModel As ModelDoc2
Dim swApp As SldWorks
swApp = New SldWorks
swModel = swApp.ActiveDoc
Dim errors As Long
Dim warnings As Long
'open drawing with config.
swModel = swApp.OpenDoc6(SW_File_Name, swDocumentTypes_e.swDocDRAWING, swOpenDocOptions_e.swOpenDocOptions_LoadLightweight, SW_Config_Name, errors, warnings)
End Sub
#End Region
SolidworksApi macros