ForceRebuild3 is not returning FALSE if there are rebuild errors.
ForceRebuild3 is not returning FALSE if there are rebuild errors.
(OP)
So I am trying to cycle through each configuration of an assembly document and check whether there are any rebuild errors. I intentionally added a mate to one configuration that causes errors, but the ForceRebuild3 method does not appear to catch it. My code is attached below. Any suggestions?
CODE
Sub main(myStr As String)
Dim SW_APP As SldWorks.SldWorks
Dim SW_DOC As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Debug.Print "**** START ****"
Debug.Print myStr
Set SW_APP = CreateObject("SldWorks.Application")
Set SW_DOC = SW_APP.ActiveDoc
SW_DOC.ShowConfiguration2 myStr
boolstatus = SW_DOC.ForceRebuild3(True)
Debug.Print "Succesful Rebuild?: " & boolstatus
Set SW_DOC = Nothing
Set SW_APP = Nothing
Debug.Print "***** END *****"
End Sub
Dim SW_APP As SldWorks.SldWorks
Dim SW_DOC As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Debug.Print "**** START ****"
Debug.Print myStr
Set SW_APP = CreateObject("SldWorks.Application")
Set SW_DOC = SW_APP.ActiveDoc
SW_DOC.ShowConfiguration2 myStr
boolstatus = SW_DOC.ForceRebuild3(True)
Debug.Print "Succesful Rebuild?: " & boolstatus
Set SW_DOC = Nothing
Set SW_APP = Nothing
Debug.Print "***** END *****"
End Sub
SW2009 x64 SP4.1, Vista Business x64, Intel Core i7 920 @4.2GHz, Quadro FX580, 2x 147GB 15K-rpm SAS HDs (RAID 0), 6GB DDR3 1600MHz RAM






RE: ForceRebuild3 is not returning FALSE if there are rebuild errors.
SW2011 x64 SP3.0, Windows 7 x64
RE: ForceRebuild3 is not returning FALSE if there are rebuild errors.
CODE
value = instance.ForceRebuild3(TopOnly)
...
Are you expecting the sub-assemblies to be rebuilding too? You have passed "True" in to the Parameters for ForceRebuild3.
Devon Murray, EIT [Mechanical]
Solidworks 2011 SP 2.0
RE: ForceRebuild3 is not returning FALSE if there are rebuild errors.
ForceRebuild3 appears to be returning "True" (-1) no matter what... I have tried declaring boolstatus as Variant type, passing it to a variable of type Long, then checking the numeric value and it still returns "-1" when there are rebuild errors in the document.
SW2011 x64 SP3.0, Windows 7 x64
RE: ForceRebuild3 is not returning FALSE if there are rebuild errors.
SW2011 x64 SP3.0, Windows 7 x64
RE: ForceRebuild3 is not returning FALSE if there are rebuild errors.
SW2011 x64 SP3.0, Windows 7 x64