<?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 回复： Auto Folder for Components (FAST) ilogic code in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12802043#M18044</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7432789"&gt;@442780782&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hello! Whether the code is implemented in Autodesk® Inventor® 2016 or not&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;why would you ever use 2016? 2020-2023 is so much faster. 2024 introduced GPU processing too.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2024 12:58:20 GMT</pubDate>
    <dc:creator>maxim.teleguz</dc:creator>
    <dc:date>2024-05-28T12:58:20Z</dc:date>
    <item>
      <title>Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12289932#M18035</link>
      <description>&lt;P&gt;finally after utilizing snippets of the best code out there I created an auto folder tool that is blazingly fast. I suggest Autodesk implements this as it is so quick.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;there are a few issues with it that I hope some beautiful people can help me solve.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Component patterns placed in folders are causing them to go above the model states folder which I didn't even think was possible.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;also if there was a way without sacrificing speed to only place components if there is more than one in the folder. currently it places all unique ones into a folder.&amp;nbsp;&lt;BR /&gt;&lt;BR /&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;Dim oDoc1 As Document
oDoc1 = ThisApplication.ActiveDocument

Dim oTopNode3 As BrowserNode
oTopNode3 = oDoc1.BrowserPanes.ActivePane.TopNode
Dim oNode3 As BrowserNode

For Each oNode3 In oTopNode3.BrowserNodes
	oNode3.DoSelect
	If oNode3.BrowserNodeDefinition.Label.Contains(":") = True Then
		If oNode3.BrowserNodeDefinition.Label.Contains("Model States") = False Then
			If oNode3.BrowserNodeDefinition.Label.Contains("Component Pattern") = False Then
			oNode3.DoSelect
			


			Try
				'define assembly doc
				Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
				'define assembly Component Definition
				Dim oAsmCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
				'Dim itemName As ComponentOccurrence
			
			
				startagain :
				SendKeys.SendWait("{ESC}")
				AppActivate(ThisApplication.Caption)
			
				c = ThisApplication.ActiveDocument.SelectSet.Item(1)
			'c = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select component")
				If c Is Nothing Then
					Exit Sub
				Else
					'get the path and file name of the selected item
					d = Component.InventorComponent(c.name).Definition.Document.FullFileName
					f = IO.Path.GetFileNameWithoutExtension(d)
					'MsgBox(f)
					'exit sub
				End If
			
				'f = InputBox("Input Wildcard of Item you want to put in the folder", "BrowserNodeItem Name", "****")
				'sFolder = f
				
				If f = "" Then
					Exit Sub
				Else If f = "** Item Name**"
					MsgBox("please enter item number")
					Exit Sub
				End If
				
				
				'get browser pane
				'Dim oPane As BrowserPane = oDoc.BrowserPanes.ActivePane
				Dim oPane As BrowserPane = oDoc.BrowserPanes("Model")
				Dim oTopNode As BrowserNode = oPane.TopNode
				
				
				'try to get existing folder by name and delete it
				'catch error if not found
				Dim oFolder As BrowserFolder 
				Try
					oFolder = oPane.TopNode.BrowserFolders.Item(f)
					oFolder.Delete
				Catch	
				End Try
				
				Dim oCollection As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
				
				'Iterate through all of the occurrences in the assembly
				Dim oOcc As ComponentOccurrence
				
				Dim part As String = "Part"
				Dim assembly As String = "Assembly"
				
				For Each oOcc In oAsmCompDef.Occurrences
				
				If oOcc.Name.Contains(f) And Inventor.DocumentTypeEnum.kPartDocumentObject Then
					If TypeOf oOcc.Definition Is PartComponentDefinition Then
						'get browser node of occurence
					    Dim oNode As BrowserNode = oPane.GetBrowserNodeFromObject(oOcc)
						'add node to collection
						oCollection.Add(oNode)
					End If
				End If
				
				If oOcc.Name.Contains(f) And Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
					If TypeOf oOcc.Definition Is AssemblyComponentDefinition Then
					      		'get browser node of occurence
					    Dim oNode1 As BrowserNode = oPane.GetBrowserNodeFromObject(oOcc)
						'add node to collection
						oCollection.Add(oNode1)	
					End If	
				End If
				
				Next
				
				' recreate folder
				'And add collection To folder
				Try
					oFolder = oPane.AddBrowserFolder(f, oCollection)
					
				Catch
					MessageBox.Show("Error", "ilogic")
				End Try
				oFolder.BrowserNode.DoSelect
				GoTo startagain
				'SOURCECODE: https://forums.autodesk.com/t5/inventor-forum/ilogic-to-create-browser-node-folder-and-move-all-iparts-and/td-p/9000788
			
			Catch
			End Try
			
			End If
		End If
	End If
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 16:54:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12289932#M18035</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2023-10-06T16:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12291424#M18036</link>
      <description>&lt;P&gt;Please let me know how this works for you as the previous occurrence builder add-in is broken for ages now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 14:29:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12291424#M18036</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2023-10-09T14:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12294277#M18037</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11604891"&gt;@maxim.teleguz&lt;/a&gt;.&amp;nbsp; If I am correct in my assessment of what your design intent here is, you want to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Select a top level assembly component before running the rule.&lt;/LI&gt;
&lt;LI&gt;Run the rule.&lt;/LI&gt;
&lt;LI&gt;The code gets the base name of the selected component (usually file name, but is customizable).&lt;/LI&gt;
&lt;LI&gt;If a BrowserFolder already exists with that name, delete it.&lt;/LI&gt;
&lt;LI&gt;Find any / all other top level components with that same base name (or same file name), and add their BrowserNode to an ObjectCollection.&lt;/LI&gt;
&lt;LI&gt;Create a new BrowserFolder and put all those component BrowserNodes into it.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Correct?&lt;/P&gt;
&lt;P&gt;If that is correct, then I do not see the logic in iterating every BrowserNode under the TopNode.BrowserNodes, and I do not see the logic in checking the ComponentDefinition Type of every component.&amp;nbsp; Also, there is no need to redefine the variable for the main assembly or the variables for the BrowserPane &amp;amp; top BrowserNode down within the loop of every BrowserNode...those can be established before the loop, because they should not change.&amp;nbsp; I have attached a couple of alternate iLogic rule codes as text files for you to review and test with.&amp;nbsp; In those examples, I am using StartsWith() instead of Contains(), and I am just getting the base name from the first part of the component's name, to save processing effort, and I have incorporated 1 or more transactions, so that these actions can easily be undone.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 16:30:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12294277#M18037</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-10-09T16:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12294464#M18038</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11604891"&gt;@maxim.teleguz&lt;/a&gt;.&amp;nbsp; I dabbled with this idea a little more, with the plan in mind to bundle all top level components into browser folders if there are more than one of them referencing the same file, and they are not 'pattern elements'.&amp;nbsp; After some brief testing, I see what you mean about some of the folders being created just under the model BrowserPane's top node.&amp;nbsp; That is definitely odd.&amp;nbsp; I attempted to exclude any components that were 'pattern elements', and that seemed to help a little, but did not eliminate the problem.&amp;nbsp; I also tried using the BrowserPane.Reorder method to move the newly created BrowserFolder to a location either just below the 'Origin' folder, or at the end of the list.&amp;nbsp; Those reorder attempts all failed.&amp;nbsp; Not sure why yet.&amp;nbsp; Attached is a text file containing the iLogic code I was testing with for this task.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 18:24:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12294464#M18038</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-10-09T18:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12294685#M18039</link>
      <description>&lt;P&gt;Thank you for testing it, I truly believe this occurrence bundler could help a lot of new ideas come to fruition which is why I want to make sure this works really well first. I will take a look at and try to understand your examples.&lt;BR /&gt;&lt;BR /&gt;My next idea will be to look for occurrences and which part they are constrained to and add them to the folder with that part.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 20:30:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12294685#M18039</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2023-10-09T20:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12297315#M18040</link>
      <description>&lt;P&gt;I did see your review in the app store on my addon "&lt;A href="https://apps.autodesk.com/INVNTOR/en/Detail/Index?id=437378080748647086" target="_blank" rel="noopener"&gt;OccurrenceBundler&lt;/A&gt;". I was surprised by your comment:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"I created illogic code for this instead and it is free."&lt;/EM&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;The add-in is also free, even the source code is free available. You can find it on &lt;A href="https://github.com/hjalte79/OccurrenceBundler" target="_blank" rel="noopener"&gt;GitHub&lt;/A&gt;. If there is something you don't like, you can alter it or add features and create a pull request.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 20:08:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12297315#M18040</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2023-10-10T20:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12298904#M18041</link>
      <description>&lt;P&gt;thank you for sharing the github link, i will study how you did your work. BTW you can use:&amp;nbsp;&lt;A href="https://converter.telerik.com/" target="_blank"&gt;https://converter.telerik.com/&lt;/A&gt;&amp;nbsp;to convert your work to vb and test variations of it and convert it back to cs.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 12:59:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12298904#M18041</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2023-10-11T12:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12617755#M18042</link>
      <description>&lt;P&gt;here is the updated code to work with 2023 and to use the displayed part name instead:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;main&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt; &lt;SPAN&gt;'define assembly doc&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;'define assembly Component Definition&lt;/SPAN&gt;

&lt;SPAN&gt;startagain&lt;/SPAN&gt; :
&lt;SPAN&gt;SendKeys&lt;/SPAN&gt;.&lt;SPAN&gt;SendWait&lt;/SPAN&gt;(&lt;SPAN&gt;"{ESC}"&lt;/SPAN&gt;)
&lt;SPAN&gt;AppActivate&lt;/SPAN&gt;(&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;Caption&lt;/SPAN&gt;)

&lt;SPAN&gt;c&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAllEntitiesFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select component"&lt;/SPAN&gt;)

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;c&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;/SPAN&gt;
	&lt;SPAN&gt;'get displayed string since that is what some content center parts show as.&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;originalString&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;c&lt;/SPAN&gt;.&lt;SPAN&gt;name&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;symbol&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;":"&lt;/SPAN&gt;
	&lt;SPAN&gt;' Find the position of the symbol&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;indexOfSymbol&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;originalString&lt;/SPAN&gt;.&lt;SPAN&gt;IndexOf&lt;/SPAN&gt;(&lt;SPAN&gt;symbol&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;' Check if the symbol is present in the string&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;indexOfSymbol&lt;/SPAN&gt; &amp;lt;&amp;gt; -1 &lt;SPAN&gt;Then&lt;/SPAN&gt;
	    &lt;SPAN&gt;' Extract the portion of the string before the symbol&lt;/SPAN&gt;
	    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;resultString&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;originalString&lt;/SPAN&gt;.&lt;SPAN&gt;Substring&lt;/SPAN&gt;(0, &lt;SPAN&gt;indexOfSymbol&lt;/SPAN&gt;)
	    &lt;SPAN&gt;'MsgBox(resultString)&lt;/SPAN&gt;
		&lt;SPAN&gt;f&lt;/SPAN&gt; = &lt;SPAN&gt;resultString&lt;/SPAN&gt;
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
	    &lt;SPAN&gt;' Symbol not found in the string&lt;/SPAN&gt;
	    &lt;SPAN&gt;'MsgBox("Symbol not found in the string.")&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt; = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt; = &lt;SPAN&gt;"** Item Name**"&lt;/SPAN&gt;
&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"please enter item number"&lt;/SPAN&gt;)
&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPane&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserPane&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;BrowserPanes&lt;/SPAN&gt;.&lt;SPAN&gt;ActivePane&lt;/SPAN&gt; &lt;SPAN&gt;'get browser pane&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oTopNode&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserNode&lt;/SPAN&gt; = &lt;SPAN&gt;oPane&lt;/SPAN&gt;.&lt;SPAN&gt;TopNode&lt;/SPAN&gt; &lt;SPAN&gt;'get browser pane top node&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFolder&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserFolder&lt;/SPAN&gt;

&lt;SPAN&gt;Try&lt;/SPAN&gt; &lt;SPAN&gt;'try to get existing folder by name and delete it&lt;/SPAN&gt;
	&lt;SPAN&gt;oFolder&lt;/SPAN&gt; = &lt;SPAN&gt;oPane&lt;/SPAN&gt;.&lt;SPAN&gt;TopNode&lt;/SPAN&gt;.&lt;SPAN&gt;BrowserFolders&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;f&lt;/SPAN&gt;)&lt;SPAN&gt;'filenamewithoutextension&lt;/SPAN&gt;
	&lt;SPAN&gt;oFolder&lt;/SPAN&gt;.&lt;SPAN&gt;Delete&lt;/SPAN&gt;
&lt;SPAN&gt;Catch&lt;/SPAN&gt; &lt;SPAN&gt;'catch error if not found&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCollection&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ObjectCollection&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateObjectCollection&lt;/SPAN&gt; &lt;SPAN&gt;'create a bucket to put stuff in&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;'Iterate through all of the occurrences in the assembly&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;part&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"Part"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;assembly&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"Assembly"&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;

	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;.&lt;SPAN&gt;Contains&lt;/SPAN&gt;(&lt;SPAN&gt;f&lt;/SPAN&gt;) &lt;SPAN&gt;And&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oNode&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserNode&lt;/SPAN&gt; = &lt;SPAN&gt;oPane&lt;/SPAN&gt;.&lt;SPAN&gt;GetBrowserNodeFromObject&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;) &lt;SPAN&gt;'get browser node of occurence&lt;/SPAN&gt;
			&lt;SPAN&gt;oCollection&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oNode&lt;/SPAN&gt;) &lt;SPAN&gt;'add node to collection&lt;/SPAN&gt;
			&lt;SPAN&gt;'MsgBox(f)&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;.&lt;SPAN&gt;Contains&lt;/SPAN&gt;(&lt;SPAN&gt;f&lt;/SPAN&gt;) &lt;SPAN&gt;And&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oNode1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserNode&lt;/SPAN&gt; = &lt;SPAN&gt;oPane&lt;/SPAN&gt;.&lt;SPAN&gt;GetBrowserNodeFromObject&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;) &lt;SPAN&gt;'get browser node of occurence&lt;/SPAN&gt;
			&lt;SPAN&gt;oCollection&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oNode1&lt;/SPAN&gt;) &lt;SPAN&gt;'add node to collection&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;oFolder&lt;/SPAN&gt; = &lt;SPAN&gt;oPane&lt;/SPAN&gt;.&lt;SPAN&gt;AddBrowserFolder&lt;/SPAN&gt;(&lt;SPAN&gt;f&lt;/SPAN&gt;, &lt;SPAN&gt;oCollection&lt;/SPAN&gt;) &lt;SPAN&gt;'recreate folder &amp;amp; add collection To folder&lt;/SPAN&gt;
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Error"&lt;/SPAN&gt;, &lt;SPAN&gt;"ilogic"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

&lt;SPAN&gt;oFolder&lt;/SPAN&gt;.&lt;SPAN&gt;BrowserNode&lt;/SPAN&gt;.&lt;SPAN&gt;DoSelect&lt;/SPAN&gt; &lt;SPAN&gt;'select folder that was created so that it you can stay in place.&lt;/SPAN&gt;
&lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;startagain&lt;/SPAN&gt;
&lt;SPAN&gt;'SOURCECODE: https://forums.autodesk.com/t5/inventor-forum/ilogic-to-create-browser-node-folder-and-move-all-iparts-and/td-p/9000788&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Mar 2024 20:47:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12617755#M18042</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2024-03-05T20:47:38Z</dc:date>
    </item>
    <item>
      <title>回复： Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12797110#M18043</link>
      <description>&lt;P&gt;Hello! Whether the code is implemented in Autodesk® Inventor® 2016 or not&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2024 09:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12797110#M18043</guid>
      <dc:creator>442780782</dc:creator>
      <dc:date>2024-05-25T09:27:10Z</dc:date>
    </item>
    <item>
      <title>回复： Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12802043#M18044</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7432789"&gt;@442780782&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hello! Whether the code is implemented in Autodesk® Inventor® 2016 or not&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;why would you ever use 2016? 2020-2023 is so much faster. 2024 introduced GPU processing too.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 12:58:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12802043#M18044</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2024-05-28T12:58:20Z</dc:date>
    </item>
    <item>
      <title>回复： Auto Folder for Components (FAST) ilogic code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12803548#M18045</link>
      <description>&lt;P&gt;Hello! Whether the code can be modified to be available in 2016&lt;BR /&gt;Run error Public member "name" of type "FaceProxy" not found.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 00:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/auto-folder-for-components-fast-ilogic-code/m-p/12803548#M18045</guid>
      <dc:creator>442780782</dc:creator>
      <dc:date>2024-05-29T00:45:28Z</dc:date>
    </item>
  </channel>
</rss>

