Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm trying to make an iLogic script to collapse all nodes in the browser. I know there's a right click menu option for that, but I'd like to have a keyboard shortcut for it.
This is what I have so far. It's working correctly, but for obvious reasons, it takes forever to run in large assemblies.
Sub main
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oTopNode As BrowserNode
oTopNode = oDoc.BrowserPanes.ActivePane.TopNode
recurse(oTopNode)
End Sub
Sub recurse(oTopNodefx)
Dim oNode As BrowserNode
For Each oNode In oTopNodefx.BrowserNodes
'check if there are any children under the ref'd node
If oNode.BrowserNodes.Count <> 0
'logger.info(oNode.BrowserNodeDefinition.Label)
'logger.info(oNode.BrowserNodes.Count)
'Exit Sub
recurse(oNode)
End If
If oNode.Visible = True And oNode.Expanded = True Then
oNode.Expanded = False
End If
Next
End Sub
Does anyone have a faster way than recursively drilling down to every single node? Is the "collapse all children" function accessible via the command manager?
Solved! Go to Solution.