You can't directly create a new folder within another folder. However, you can create a new folder at the top level and then move it into another folder, which results in the same thing. Below are two VBA macros that do this in different ways. The first creates the two folders and then moves one into the other. The other creates the subfolders first and then moves them into the top folder during its creation.
There's one weird behavior of Inventor that you can't reorder folders if that's all that's in the assembly. This means the first program will fail if run with an empty assembly. However, it works if there's even one occurrence. You see the same behavior in the UI. The second program works even in an empty assembly. So the second example is probably the best approach.
Public Sub BrowserFolders1()
Dim asmDoc As AssemblyDocument
Set asmDoc = ThisApplication.ActiveDocument
Dim pane As BrowserPane
Set pane = asmDoc.BrowserPanes.ActivePane
Dim topFolder As BrowserFolder
Set topFolder = pane.AddBrowserFolder("Top Folder")
Dim subFolder As BrowserFolder
Set subFolder = pane.AddBrowserFolder("Sub Folder")
Call topFolder.Add(subFolder.BrowserNode)
End Sub
Public Sub BrowserFolders2()
Dim asmDoc As AssemblyDocument
Set asmDoc = ThisApplication.ActiveDocument
Dim pane As BrowserPane
Set pane = asmDoc.BrowserPanes.ActivePane
Dim subFolder1 As BrowserFolder
Set subFolder1 = pane.AddBrowserFolder("Sub Folder 1")
Dim subFolder2 As BrowserFolder
Set subFolder2 = pane.AddBrowserFolder("Sub Folder 2")
Dim folders As ObjectCollection
Set folders = ThisApplication.TransientObjects.CreateObjectCollection
Call folders.Add(subFolder1.BrowserNode)
Call folders.Add(subFolder2.BrowserNode)
Dim topFolder As BrowserFolder
Set topFolder = pane.AddBrowserFolder("Top Folder", folders)
End Sub
---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com