In diesem Video werde ich euch eine andere Möglichkeit zeigen, wie in einem Teil Dokument der FeatureManager durchsucht werden kann.
Und an dieser Stelle der Code der im Makro vorhanden ist.
Option Explicit
Sub main()
Dim swApp As SldWorks.SldWorks
Set swApp = Application.SldWorks
Dim swModel As ModelDoc2
Set swModel = swApp.ActiveDoc
If swModel Is Nothing Then
swApp.SendMsgToUser2 "Keine Datei geöffnet.", swMessageBoxIcon_e.swMbStop, swMessageBoxBtn_e.swMbOk
Exit Sub
End If
Dim L0Feature As Feature
Dim L1Feature As Feature
Dim L2Feature As Feature
Set L0Feature = swModel.FirstFeature
While Not L0Feature Is Nothing
Debug.Print L0Feature.Name
Set L1Feature = L0Feature.GetFirstSubFeature
While Not L1Feature Is Nothing
Debug.Print " " & L1Feature.Name
Set L2Feature = L1Feature.GetFirstSubFeature
While Not L2Feature Is Nothing
Debug.Print " " & L2Feature.Name
Set L2Feature = L2Feature.GetNextSubFeature
Wend
Set L1Feature = L1Feature.GetNextSubFeature
Wend
Set L0Feature = L0Feature.GetNextFeature
Wend
End Sub