Get Weldment Trim Extend Corner Type Example (VBA)
This example shows how to get the type of corner used for a weldment
trim extend feature.
'------------------------------
'
' Preconditions: Model document is open and has
' a
weldment trim extend feature
'
' Postconditions: None
'
'-------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swFeature As SldWorks.Feature
Dim swWeldmentTrimExtend As SldWorks.WeldmentTrimExtendFeatureData
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
'Traverse FeatureManager design tree
'Get first feature in FeatureManager design tree
Set swFeature = swModel.FirstFeature
'If the type of feature is "WeldCornerFeat"
then get the
'WeldmentTrimFeatureData object and then get the type
of corner
Do While Not swFeature Is Nothing
If
swFeature.GetTypeName = "WeldCornerFeat" Then
Debug.Print
swFeature.Name, swFeature.GetTypeName
Set
swWeldmentTrimExtend = swFeature.GetDefinition
Debug.Print
swWeldmentTrimExtend.CornerType
End
If
'
Get the next feature in the FeatureManager design tree
Set
swFeature = swFeature.GetNextFeature
Loop
End Sub