Clear Display States Example (VBA)
This example shows how to clear the display states from a part.
'----------------------------------------------------------------------------
' Preconditions: Open a part document.
'
' Postconditions:
' 1. All appearances are removed from all configurations of the part.
' 2. The display states are un-linked from configurations.
' 3. All features of the part are now visible.
' ---------------------------------------------------------------------------
Dim swApp As SldWorks.SldWorks
Dim modelDoc As SldWorks.ModelDoc2
Dim partDoc As SldWorks.PartDoc
Dim boolstatus As Boolean
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set modelDoc = swApp.ActiveDoc
Set partDoc = modelDoc
boolstatus = partDoc.RemoveAllDisplayStates
End Sub