Capturing the browser node name in a multi-level patterns with iLogic

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am looking for help modifying a code I found. The code below works great for single level patterns, however I would like to expand this to search multi-level patterns. The highlight items in the screen shot are the parts that I am attempting to grab the Browsers Node names.
Dim doc = ThisDoc.DocumentDim
BrowserPane = doc.BrowserPanes("Model")
Dim TopNode = BrowserPane.TopNode
Dim CompNode As ComponentOccurrence
EndFound = False
For Each node As BrowserNode In TopNode.BrowserNodes
If node.BrowserNodeDefinition.Label Like "GAS MOUNTING PATTERN" Then EndFound = True
If EndFound = True Then
CompName = node.BrowserNodes.Item(1).BrowserNodes.Item(1).BrowserNodeDefinition.Label
CompNode = doc.ComponentDefinition.Occurrences.ItemByName(CompName)
Exit For
End If
Next
If Not CompNode Is Nothing Then MessageBox.Show("CompNodeName = " & CompNode.Name, "Title")