Get and Set the State of the Flyout FeatureManager Design Tree Example (VBA)
This example shows how to display, expand, and hide the flyout FeatureManager
design tree.
'----------------------------------------------------------------------------
' Preconditions: Open a SolidWorks document
'
' Postconditions: Click OK to close each of three message
boxes.
'
---------------------------------------------------------------------------
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim ext As SldWorks.ModelDocExtension
Dim Status As Long
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set ext = Part.Extension
Status = ext.FlyoutFeatureTreeVisibility
Debug.Print "-------Flyout state at
start-------"
If Status = swFlyoutFeatureTree_Hidden Then Debug.Print "FlyoutFeatureTree
Hidden"
If Status = swFlyoutFeatureTree_ShownExpanded Then
Debug.Print "FlyoutFeatureTree Expanded"
If Status = swFlyoutFeatureTree_ShownUnExpanded Then
Debug.Print "FlyoutFeatureTree UnExpanded"
ext.FlyoutFeatureTreeVisibility =
swFlyoutFeatureTree_ShownExpanded
Status = ext.FlyoutFeatureTreeVisibility
If Status = swFlyoutFeatureTree_ShownExpanded Then MsgBox ("Flyout
state is now swFlyoutFeatureTree_ShownExpanded.")
ext.FlyoutFeatureTreeVisibility =
swFlyoutFeatureTree_ShownUnExpanded
Status = ext.FlyoutFeatureTreeVisibility
If Status = swFlyoutFeatureTree_ShownUnExpanded Then MsgBox
("Flyout state is now swFlyoutFeatureTree_ShownUnExpanded.")
ext.FlyoutFeatureTreeVisibility =
swFlyoutFeatureTree_Hidden
Status = ext.FlyoutFeatureTreeVisibility
If Status = swFlyoutFeatureTree_Hidden Then MsgBox ("Flyout
state is now swFlyoutFeatureTree_Hidden.")
End Sub