Till recent I was sure there could be no Folders in the Model Browser structure of Part-model (because I don't know how to create it manually).
I was surprised to know the BrowserPane.AddBrowserFolder Method in fact is not limited to Assemblies.
Below is the iLogic code that creates the custom object (WorkPlane), Folder, and puts the object into the folder:
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim cmpDef = oDoc.ComponentDefinition
Dim oPane As BrowserPane = oDoc.BrowserPanes.ActivePane
Dim oTOs As TransientObjects = ThisApplication.TransientObjects
Dim subNodes As ObjectCollection = oTOs.CreateObjectCollection
Dim oWPl As WorkPlane = cmpDef.WorkPlanes.AddByPlaneAndOffset(cmpDef.WorkPlanes(1), 0)
Dim node = oPane.GetBrowserNodeFromObject(oWPl)
subNodes.Add(node)
Dim oFolder As BrowserFolder = oPane.AddBrowserFolder(, subNodes)
Here is a result if after run within the new IPT:
The folder can be expanded and collapsed, It's child nodes can be deleted.
But there are some problems with doing other things that user expect to work:
- can't delete the folder itself (even empty).
- can't move nodes out and into the folder.
I'd like to know whether I'm missing something that can make the folder fully functional for Part?
Adding folder seems also somehow breaks the part browser itself - nodes of new objects do appear from the top (not below the 'Origin' node):
PS:
Everything described was reproduced in 2024.2 and 2023.4.1
Yep. Pretty frustrating. I have wanted this ability for many years, and voted for the idea too. It does seem to be on their radar, but for some reason they claim that it is pretty complicated to implement. I will post a link to the idea below, just to steer more votes towards it, but I'm not holding my breath. I commented on that idea earlier after yet another API code test, and got similar results as you and others over the years.
https://forums.autodesk.com/t5/inventor-ideas/browser-folders-in-part-environment/idi-p/3780620
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.