Rebuild Model Example (VBA)
The example shows how to rebuild the model by using IModelDoc2::EditRebuild3
and IModelDoc2::ForceRebuild3.
'---------------------------------------------
Sub main()
Dim
swApp As Object
Dim
Part As Object
Dim
boolstatus As Boolean
Dim
topOnly As Boolean
Set
swApp = CreateObject("SldWorks.Application")
Set
Part = swApp.ActiveDoc
If
Part.EditRebuild3() Then
MsgBox
"Rebuild successful"
Else
MsgBox
"This model has rebuild errors"
End
If
topOnly
= True
If
Part.ForceRebuild3(topOnly) Then
MsgBox
"Forced rebuild successful"
Else
MsgBox
"This model has rebuild errors"
End
If
End Sub