Get Active PropertyManager Page Name (VBA)
This example shows how to get the name of the active PropertyManager page.
'----------------------------------------------------------------------------
' Preconditions:
' 1. Specified part document exists.
' 2. Open the Immediate window.
' 3. Run the macro.
'
' Postconditions:
' 1. When Stop executes:
' a. In the SolidWorks user-interface,
' click Insert > Features > Fillet/Round.
' b. In the IDE, click Continue.
' 2. The name of the active PropertyManager page is
' written to the Immediate window.
' 3. In the SolidWorks user-interface:
' a. Close the PropertyManager page.
' b. Close the part document.
'----------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim file As String
Dim errors As Long
Dim warnings As Long
Dim pageName As String
Sub main()
Set swApp = Application.SldWorks
file = "C:\Program Files\SolidWorks Corp\SolidWorks\samples\tutorial\fillets\knob.sldprt"
Set swModel = swApp.OpenDoc6(file, swDocPART, swOpenDocOptions_Silent, "", errors, warnings)
Set swModelDocExt = swModel.Extension
Stop
' 1. Click Insert > Features > Fillet/Round in the SolidWorks user-interface
' 2. Click Continue in the IDE
' Print the name of the active PropertyManager page in the Immediate window
pageName = swModelDocExt.GetActivePropertyManagerPage
Debug.Print "Name of active PropertyManager page: " & pageName
End Sub