Get Depth of Extrusion Example (VBA)
This example shows how to get the depth of an extrusion.
'----------------------------------------------------------------------------
' Preconditions: Open a part containing a Boss-Extrude1 feature.
'
' Postconditions: None
'----------------------------------------------------------------------------
Option Explicit
Sub main()
Dim swApp
As SldWorks.SldWorks
Dim swModel
As SldWorks.ModelDoc2
Dim swDim
As SldWorks.Dimension
Dim vConfigNames
As Variant
Dim vValue
As Variant
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swDim = swModel.Parameter("D1@Boss-Extrude1")
Debug.Assert Not swDim Is Nothing
Debug.Print "File = " & swModel.GetPathName
Debug.Print " FullName = " &
swDim.FullName
Debug.Print " Name
= " & swDim.Name
vConfigNames = swModel.GetConfigurationNames
vValue = swDim.GetSystemValue3(swThisConfiguration, (vConfigNames))
Debug.Print " SystemValue = "
& vValue(0) * 1000#; "" & " mm"
End Sub