-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Adam Hoffman Jun 18, 2015 10:45 AM (in response to Mike Campbell)Have you tried leaving the configuration string blank?
-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Mike Campbell Jun 18, 2015 11:06 AM (in response to Adam Hoffman)I tried with no difference.
-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Adam Hoffman Jun 18, 2015 11:53 AM (in response to Mike Campbell)Could you post a little more code so we can see what's going on exactly?
-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Mike Campbell Jun 18, 2015 12:55 PM (in response to Adam Hoffman)Sub ListCustomProperty(strCompRef As String, sFileNameAndPath As String, strRefCfg As String)
Dim swApp As SldWorks.SldWorks
Dim swIndividualItemConfig As SldWorks.Configuration
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim lRetVal As Long
Dim vPropNames As Variant
Dim vPropTypes As Variant
Dim vPropValues As Variant
Dim ValOut As String
Dim ResolvedValOut As String
Dim wasResolved As Boolean
Dim resolved As Variant
Dim nNbrProps As Long
Dim j As Long
Dim custPropType As Long
Dim swIndividualItem As SldWorks.ModelDoc
Dim swFileError As Long
Dim swFileWarning As Long
'...continue building the sublist...
Open "D:\Configurator\PropertyList.txt" For Append As #1
Set swApp = Application.SldWorks
'Establish whether the item is an individual part or an subassembly and open file
If InStr(1, sFileNameAndPath, ".sldasm") = 0 And InStr(1, sFileNameAndPath, ".SLDASM") = 0 Then
Set swIndividualItem = swApp.OpenDoc6(sFileNameAndPath, swDocPART, swOpenDocOptions_Silent, strRefCfg, swFileError, swFileWarning)
Else
Set swIndividualItem = swApp.OpenDoc6(sFileNameAndPath, swDocASSEMBLY, swOpenDocOptions_Silent, strRefCfg, swFileError, swFileWarning)
End If
-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Adam Hoffman Jun 18, 2015 1:08 PM (in response to Mike Campbell)So are you saying that the swIndividualItem is nothing, or does it return the modeldoc object but you want it displayed in the active window?
I would also suggest writing your if statement like this:
If InStr(1, UCase(sFileNameAndPath), ".SLDASM") = 0 Then
Set swIndividualItem = swApp.OpenDoc6(sFileNameAndPath, swDocPART, swOpenDocOptions_Silent, strRefCfg, swFileError, swFileWarning)
Else
Set swIndividualItem = swApp.OpenDoc6(sFileNameAndPath, swDocASSEMBLY, swOpenDocOptions_Silent, strRefCfg, swFileError, swFileWarning)
End If
-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Mike Campbell Jun 18, 2015 1:26 PM (in response to Adam Hoffman)There's no issue with it finding and opening all the models. Everything in the macro works as intended except some of the models (the suppressed models) don't open "silent".
-
Re: swOpenDocOptions_Silent doesn't work with suppressed components
Adam Hoffman Jun 18, 2015 2:05 PM (in response to Mike Campbell)Well, sorry I can't be of more help. I don't see anything in the remarks in the API help to point to a solution for OpenDoc6.
-
-
-
-
-
-