Hello,
In one of my macros, I would like to rearrange the folders in the tree structure.
I would like to move the "Screws" folder to the very end of the tree, and the "FI" folder just above the "Screws" folder.
Only if the folders have parts or assemblies between them as on the pictures the moved folders are not placed at the end.
Do you have an idea how to move these folders as desired?

Enclosed you will find the code and an example of how to assemble them.
Sub main()<br> Dim swApp As SldWorks.SldWorks<br> Dim swModel As SldWorks.ModelDoc2<br> Dim swAssy As SldWorks.AssemblyDoc<br> Dim modelDocExt As SldWorks.ModelDocExtension<br> Dim bRet As Boolean<br><br> Set swApp = Application.SldWorks<br> Set swModel = swApp.ActiveDoc<br> Set swAssy = swModel<br><br><br><br><br> Set modelDocExt = swAssy.Extension<br> bRet = modelDocExt.ReorderFeature("FI", "", swMoveToEnd)<br> bRet = modelDocExt.ReorderFeature("Visserie", "", swMoveToEnd)<br><br>End Sub<span class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span>SolidworksApi/macros