Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fully functional BrowserFolder(s) in browser structure of the Part-model

2 REPLIES 2
Reply
Message 1 of 3
Maxim-CADman77
256 Views, 2 Replies

Fully functional BrowserFolder(s) in browser structure of the Part-model

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:

MaximCADman77_0-1700512266546.png

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?

2 REPLIES 2
Message 2 of 3

Adding folder seems also somehow breaks the part browser itself - nodes of new objects do appear from the top (not below the 'Origin' node):

MaximCADman77_0-1700546914963.png

PS:
Everything described was reproduced in 2024.2 and 2023.4.1 

Message 3 of 3
WCrihfield
in reply to: Maxim-CADman77

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

EESignature

(Not an Autodesk Employee)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report