<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assembly Model tree Reorder fail for specifc Folder in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135074#M121796</link>
    <description>&lt;P&gt;Danke krieg it helps a lot&lt;/P&gt;</description>
    <pubDate>Sat, 06 Mar 2021 10:54:37 GMT</pubDate>
    <dc:creator>filippo.toniello</dc:creator>
    <dc:date>2021-03-06T10:54:37Z</dc:date>
    <item>
      <title>Assembly Model tree Reorder fail for specifc Folder</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10132583#M121759</link>
      <description>&lt;P&gt;Hi everyoone&lt;/P&gt;&lt;P&gt;I searched through the forum but i did not find any related info.&lt;/P&gt;&lt;P&gt;I adapted an existing ilogic code to find all screws, bolt, nuts and washer from content center and&amp;nbsp; moving to a folder in the browser tree. It works like a charm but i would also move this folder under the "origin" folder.&lt;/P&gt;&lt;P&gt;I used the reorder method but i encounter a unspecified error. Someone can helpme?&lt;/P&gt;&lt;P&gt;here the error&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-03-05 10_13_31-Autodesk Inventor Professional 2020.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/889160i534749E3B41E0591/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-03-05 10_13_31-Autodesk Inventor Professional 2020.png" alt="2021-03-05 10_13_31-Autodesk Inventor Professional 2020.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'define folder name to use
sFolder = "VITERIE"

'define assembly doc
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

'define assembly Component Definition
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oDoc.ComponentDefinition

'get browser pane
Dim oPane As BrowserPane 
oPane = oDoc.BrowserPanes.ActivePane


'try to get existing folder by name and delete it
'catch error if not found
Dim oFolder As BrowserFolder 
Try
	oFolder = oPane.TopNode.BrowserFolders(sFolder)
	oFolder.Delete
Catch	
End Try

Dim oCollection As ObjectCollection
oCollection = ThisApplication.TransientObjects.CreateObjectCollection

'Iterate through all of the occurrences in the assembly
Dim oOcc As ComponentOccurrence
For Each oOcc In oAsmCompDef.Occurrences
	'look at only virtual components
	If oOcc.DefinitionDocumentType=kPartDocumentObject Then
		If oOcc.Definition.IsContentMember Then
			Dim Opartdef As PartcomponentDefinition
			Opartdef = oOcc.Definition
			Dim oObjPart As PartDocument
			oObjPart = Opartdef.Document
			Dim invDesignInfo As PropertySet
			invDesignInfo = oObjPart.PropertySets.Item("Design Tracking Properties")
			
			If Left(invDesignInfo.Item("Description").Value,3) = "VIT" Or Left(invDesignInfo.Item("Description").Value,3) = "DAD" Or Left(invDesignInfo.Item("Description").Value,3) = "ROS" Or Left(invDesignInfo.Item("Description").Value,3) = "RON" Then
			
				'get browser node of occurence
				Dim oNode As BrowserNode
				oNode = oPane.GetBrowserNodeFromObject(oOcc)
				'add node to collection
				oCollection.Add(oNode)
			
			End If	
		End If
	End If	
Next
' recreate folder
'And add collection To folder
 
oFolder = oPane.AddBrowserFolder(sFolder,oCollection)
Dim oNNode As BrowserNode
	oNNode = oFolder.BrowserNode

Dim oDocNode As BrowserNode
oDocNode = oPane.TopNode
Dim oPosNode As BrowserNode

Dim oInizNode As BrowserNode
For Each oInizNode In oDocNode.BrowserNodes	
	If oInizNode.FullPath.Contains("Origine") Then
	oPosNode = oInizNode
		End IF
Next


' ' Move the folders to upper of oFirstOccurrenceNode
oPane.Reorder(oPosNode,False,oNNode)
   
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 09:27:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10132583#M121759</guid>
      <dc:creator>filippo.toniello</dc:creator>
      <dc:date>2021-03-05T09:27:28Z</dc:date>
    </item>
    <item>
      <title>Betreff: Assembly Model tree Reorder fail for specifc Folder</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10134960#M121793</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can not place your folder below the origin node. As in the GUI the highest position is below end of part.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 08:57:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10134960#M121793</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2021-03-06T08:57:03Z</dc:date>
    </item>
    <item>
      <title>Betreff: Assembly Model tree Reorder fail for specifc Folder</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135049#M121794</link>
      <description>&lt;P&gt;ok thakns for the reply.&lt;/P&gt;&lt;P&gt;But in the GUI i can do this (please see pict below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-03-06 11_21_36-Autodesk Inventor Professional 2020.png" style="width: 301px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/889528i3300320A673477F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-03-06 11_21_36-Autodesk Inventor Professional 2020.png" alt="2021-03-06 11_21_36-Autodesk Inventor Professional 2020.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible to do the same with ilogic?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 10:24:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135049#M121794</guid>
      <dc:creator>filippo.toniello</dc:creator>
      <dc:date>2021-03-06T10:24:16Z</dc:date>
    </item>
    <item>
      <title>Betreff: Assembly Model tree Reorder fail for specifc Folder</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135070#M121795</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, there are BrowserNodes between, but they are invisible. Between your folder and the origin are at least the Positional Representation and the End of Element Nodes. I use a localized german version, so I can't tell you the right name of the nodes. You can check this with this little iLogic Script&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oDoc.ComponentDefinition

Dim oPane As BrowserPane 
oPane = oDoc.BrowserPanes.ActivePane

Dim oDocNode As BrowserNode
oDocNode = oPane.TopNode

Dim oNode As BrowserNode
Dim bVisible As Boolean 

For Each oNode In oDocNode.BrowserNodes 
	bVisible=oNode.Visible.ToString 
	MsgBox("Name: " &amp;amp; oNode.BrowserNodeDefinition.Label &amp;amp; vbCrLf &amp;amp; "Visible: " &amp;amp; bVisible, , "NodeNames")
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 10:50:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135070#M121795</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2021-03-06T10:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Assembly Model tree Reorder fail for specifc Folder</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135074#M121796</link>
      <description>&lt;P&gt;Danke krieg it helps a lot&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 10:54:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-model-tree-reorder-fail-for-specifc-folder/m-p/10135074#M121796</guid>
      <dc:creator>filippo.toniello</dc:creator>
      <dc:date>2021-03-06T10:54:37Z</dc:date>
    </item>
  </channel>
</rss>

