<?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 iLogic Create Copies To Network Library Folder With Unique Part Number Counter in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345331#M90328</link>
    <description>&lt;P&gt;Hello, I am looking for help to achieve the following.&lt;/P&gt;
&lt;P&gt;On a network share there is a libraryfolder with subfolders filled with parts, from which we want to make copies into our working/project folder. The parts in the library are always like &amp;lt;code&amp;gt;_&amp;lt;6digitnumber&amp;gt;.ipt (ex: THYU_985236.ipt)&lt;/P&gt;
&lt;P&gt;The copied parts in our projectfolder needs to stay unique, so after the partnumber there needs to be a counter added (ex: : THYU_985236_001.ipt, THYU_985236_002.ipt, THYU_985236_003.ipt)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The iLogic code needs to:&lt;/P&gt;
&lt;P&gt;- ask for a 6 digit number.&lt;/P&gt;
&lt;P&gt;- look for the part on the networkshare. (exit if it don’t exist)&lt;/P&gt;
&lt;P&gt;- check if the file is already copied before (in the whole project folder .ipj &amp;amp; subfolders) and if so, modifies the COUNTER&lt;/P&gt;
&lt;P&gt;- copy the part with the new filename to the folder where the active assembly resides&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The copied parts need to be unique in the whole project, because they need custom properties which are unique tot the part (TAG Nr from P&amp;amp;ID)&lt;/P&gt;
&lt;P&gt;Many Thanks!&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt;&lt;SPAN style="color: #808000;"&gt;kelly.young&lt;/SPAN&gt;&amp;nbsp;has edited your subject line for clarity:&amp;nbsp;&lt;EM&gt;iLogic help&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 18:06:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-19T18:06:27Z</dc:date>
    <item>
      <title>iLogic Create Copies To Network Library Folder With Unique Part Number Counter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345331#M90328</link>
      <description>&lt;P&gt;Hello, I am looking for help to achieve the following.&lt;/P&gt;
&lt;P&gt;On a network share there is a libraryfolder with subfolders filled with parts, from which we want to make copies into our working/project folder. The parts in the library are always like &amp;lt;code&amp;gt;_&amp;lt;6digitnumber&amp;gt;.ipt (ex: THYU_985236.ipt)&lt;/P&gt;
&lt;P&gt;The copied parts in our projectfolder needs to stay unique, so after the partnumber there needs to be a counter added (ex: : THYU_985236_001.ipt, THYU_985236_002.ipt, THYU_985236_003.ipt)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The iLogic code needs to:&lt;/P&gt;
&lt;P&gt;- ask for a 6 digit number.&lt;/P&gt;
&lt;P&gt;- look for the part on the networkshare. (exit if it don’t exist)&lt;/P&gt;
&lt;P&gt;- check if the file is already copied before (in the whole project folder .ipj &amp;amp; subfolders) and if so, modifies the COUNTER&lt;/P&gt;
&lt;P&gt;- copy the part with the new filename to the folder where the active assembly resides&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The copied parts need to be unique in the whole project, because they need custom properties which are unique tot the part (TAG Nr from P&amp;amp;ID)&lt;/P&gt;
&lt;P&gt;Many Thanks!&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt;&lt;SPAN style="color: #808000;"&gt;kelly.young&lt;/SPAN&gt;&amp;nbsp;has edited your subject line for clarity:&amp;nbsp;&lt;EM&gt;iLogic help&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:06:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345331#M90328</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-19T18:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies To Network Library Folder With Unique Part Number Count</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345431#M90329</link>
      <description>&lt;P&gt;Hello, I am looking for help to achieve the following.&lt;/P&gt;
&lt;P&gt;On a network share there is a libraryfolder with subfolders filled with parts, from which we want to make copies into our working/project folder. The parts in the library are always like &amp;lt;code&amp;gt;_&amp;lt;6digitnumber&amp;gt;.ipt (ex: THYU_985236.ipt)&lt;/P&gt;
&lt;P&gt;The copied parts in our projectfolder needs to stay unique, so after the &lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;STRONG&gt;filename&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt; there needs to be a counter added (ex: : THYU_985236_001.ipt, THYU_985236_002.ipt, THYU_985236_003.ipt)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The iLogic code needs to:&lt;/P&gt;
&lt;P&gt;- ask for a 6 digit number.&lt;/P&gt;
&lt;P&gt;- look for the part on the networkshare. (exit if it don’t exist)&lt;/P&gt;
&lt;P&gt;- check if the file is already copied before (in the whole project folder .ipj &amp;amp; subfolders) and if so, modifies the COUNTER&lt;/P&gt;
&lt;P&gt;- copy the part with the new filename to the folder where the active assemby reisdes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The copied parts need to be unique in the whole project, because they need custom properties which are unique tot the part (TAG Nr from P&amp;amp;ID)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this doable in iLogic anyway?&lt;/P&gt;
&lt;P&gt;Many Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:06:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345431#M90329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-19T18:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies To Network Library Folder With Unique Part Number Count</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345605#M90330</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Programming needs, issues, and questions for Inventor should be asked on the Inventor Customization forum for best results.&amp;nbsp; I will have the moderator relocate your posting there to best suit your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/bd-p/120&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:07:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8345605#M90330</guid>
      <dc:creator>Mark.Lancaster</dc:creator>
      <dc:date>2018-10-19T18:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies To Network Library Folder With Unique Part Number Count</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346191#M90331</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;As mentioned&amp;nbsp;, you can search and ask programming questions of this type on the Inventor Customization forum:&lt;BR /&gt;&lt;A href="http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120" target="_blank"&gt;http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But here is a quick example that will do what you're looking for. I would create this as an external rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Imports System.IO
GetInput:

Six_Digit = InputBox("Enter 6 Digit number", "iLogic", )

If Six_Digit = "" Then
	Return
Else If Len(Six_Digit) &amp;lt;&amp;gt; "6" Then
	MessageBox.Show("Input must be 6 digits", "ilogic")
	Goto GetInput

End If


Dim oDoc As Document
Dim sFilename As String

oFolder = "C:\TEMP\Library\"

Dim oFilenames() As String 
oFilenames = System.IO.Directory.GetFiles(oFolder, _ 
                      "*.*", SearchOption.AllDirectories )
					  
For Each oFilename As String In oFilenames 
	If oFilename.Contains(Six_Digit) Then
		Dim oOptions As Inventor.NameValueMap
		oOptions = ThisApplication.TransientObjects.CreateNameValueMap		
		oDoc = ThisApplication.Documents.OpenWithOptions(oFilename, oOptions, False)	
		sFilename = oFilename
		Exit For
	End If
Next 

If sFilename = "" Then
	MessageBox.Show("No matching libary file found.", "iLogic")
	Return
End If

iCounter = 0
oProjectfolder  = "C:\TEMP\Work\"

Dim oProject_Filenames() As String 
oProject_Filenames = System.IO.Directory.GetFiles(oProjectfolder, _ 
                      "*.*", SearchOption.AllDirectories )
					  
'count existing project files					  
For Each oFilename As String In oProject_Filenames 
	If oFilename.Contains(Six_Digit) Then
		iCounter = iCounter + 1
	End If
Next 

'increment counter
iCounter = iCounter + 1


'find the postion of the last backslash in the path
FNamePos = InStrRev(sFilename, "\", -1)   
'get the file name with the file extension
oName = Right(sFilename, Len(sFilename) - FNamePos)
'get the file name (without extension)
ShortName = Left(oName, Len(oName) - 4)
'get extension
oExt = Right(oName, 4)


If iCounter &amp;lt; 10 Then
	iCounter = "00" + CStr(iCounter)
ElseIf iCounter &amp;lt; 100 Then
	iCounter ="0" + CStr(iCounter)
Else 
	iCounter = CStr(iCounter)
End If

oNewName = ShortName &amp;amp; "_" &amp;amp; iCounter

'save new document
oDoc.SaveAs(oProjectfolder &amp;amp; oNewName &amp;amp; oExt, True)
oDoc.Close

MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oProjectfolder &amp;amp; oNewName &amp;amp; oExt, "iLogic")
&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:07:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346191#M90331</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2018-10-19T18:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies To Network Library Folder With Unique Part Number Count</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346219#M90332</link>
      <description>&lt;P&gt;Wow, thank you very much. Did you wrote this just now, or did you have something simular on the shelve? I can only test this on monday&amp;nbsp;@Anonymous&lt;/a&gt;, but thanks again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it correct that i have to set the projectfolder in the code? So every new project, I have to modify this part of the code, right?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:07:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346219#M90332</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-19T18:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies To Network Library Folder With Unique Part Number Count</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346683#M90334</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This was put together as an example just from other examples from the past.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for changing the project, most likely it could determine the project folder from the some info in the&amp;nbsp; current*.ipj file, or the current open file, or something along those lines... for example, you could just create this an an external rule, and then run it from an open assembly file that resides in the project folder, and the code would just look at the assembly file's location to determine the folder automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post back next week with more info, and i can likely help you make a quick update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:33:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346683#M90334</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2018-10-19T18:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346785#M90336</link>
      <description>&lt;P&gt;Yes, that folder automation ("project workspace folder" setting from the active ipj file) would be great.&lt;/P&gt;&lt;P&gt;One more thing; the freshly created unique part, should be inserted in the assembly, ready for constraining.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I definitly need to learn iLogic; never knew you could go so deep in programming inside inventor. Hope this works on monday! Thanks again.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 19:25:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8346785#M90336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-19T19:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8347141#M90351</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a quick update that uses the parent folder of the current file (it expects an assembly).... &amp;nbsp;as the "copy to" folder... and then this version places the component into the assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Imports System.IO
GetInput:

Six_Digit = InputBox("Enter 6 Digit number", "iLogic", 985236 )

If Six_Digit = "" Then
	Return
Else If Len(Six_Digit) &amp;lt;&amp;gt; "6" Then
	MessageBox.Show("Input must be 6 digits", "ilogic")
	Goto GetInput

End If


Dim oDoc As Document
Dim sFilename As String

'hard code path
oLibrary_Folder = "C:\TEMP\Library\"


Dim oFilenames() As String 
oFilenames = System.IO.Directory.GetFiles(oLibrary_Folder, _ 
                      "*.*", SearchOption.AllDirectories )
					  
For Each oFilename As String In oFilenames 
	If oFilename.Contains(Six_Digit) Then
		Dim oOptions As Inventor.NameValueMap
		oOptions = ThisApplication.TransientObjects.CreateNameValueMap		
		oDoc = ThisApplication.Documents.OpenWithOptions(oFilename, oOptions, False)	
		sFilename = oFilename
		Exit For
	End If
Next 

If sFilename = "" Then
	MessageBox.Show("No matching libary file found.", "iLogic")
	Return
End If

iCounter = 0

'path from current file
'oProjectfolder = ThisDoc.Path &amp;amp; "\"

'path from current project file ( *.ipj)
oProjectfolder = _
ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath &amp;amp; "\"


Dim oProject_Filenames() As String 
oProject_Filenames = System.IO.Directory.GetFiles(oProjectfolder, _ 
                      "*.*", SearchOption.AllDirectories )
					  
'count existing project files					  
For Each oFilename As String In oProject_Filenames 
	If oFilename.Contains(Six_Digit) Then
		iCounter = iCounter + 1
	End If
Next 

'increment counter
iCounter = iCounter + 1


'find the postion of the last backslash in the path
FNamePos = InStrRev(sFilename, "\", -1)   
'get the file name with the file extension
oName = Right(sFilename, Len(sFilename) - FNamePos)
'get the file name (without extension)
ShortName = Left(oName, Len(oName) - 4)
'get extension
oExt = Right(oName, 4)


If iCounter &amp;lt; 10 Then
	iCounter = "00" + CStr(iCounter)
ElseIf iCounter &amp;lt; 100 Then
	iCounter ="0" + CStr(iCounter)
Else 
	iCounter = CStr(iCounter)
End If

oNewName = ShortName &amp;amp; "_" &amp;amp; iCounter

oPathandName = oProjectfolder &amp;amp; oNewName &amp;amp; oExt

'save new document
oDoc.SaveAs(oPathandName, True)
oDoc.Close

'[ Place Component
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

' Create Matrix
Dim oMatrix As Matrix
oMatrix = ThisApplication.TransientGeometry.CreateMatrix
Call oMatrix.SetTranslation(ThisApplication.TransientGeometry.CreateVector(50, 50, 50), True)


'insert new occurence
Dim oOcc As ComponentOccurrence
oOcc = oAsmCompDef.Occurrences.Add( _
    oPathandName, oMatrix)
	
oOcc.grounded = False	
ThisDoc.Document.SelectSet.Select(oOcc)

']

'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 22:14:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8347141#M90351</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2018-10-19T22:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8347402#M90353</link>
      <description>&lt;P&gt;#curtisforpresident&lt;/P&gt;&lt;P&gt;#whichitwasalreadymondaytotest&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 06:56:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8347402#M90353</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-20T06:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8349273#M90376</link>
      <description>&lt;P&gt;This is a great piece of code Curtis, simple and it does the job well. It could come in handy for everyone who don't like to work with Content Center, Library folder of which the parts are not allowed their iproperties to be updated.&lt;/P&gt;&lt;P&gt;It just copies parts from a folder, to your active workspace and keeps them unique. If you don't want them to be unique, just drag the same part from your model browser, so you got 2 instances of the same object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing that would be nice is to (1) show all origin and working planes and (2) activate the constrain dialog after the part is placed in the assembly. I think I can use iMates to simplify the constraining process. (3) hide all the origin and working planes to finnish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what if in time there are "Oldversion" folders, with filenames that contains the same 6 digits as the original?&amp;nbsp;Or&amp;nbsp; are "Oldversion" excluded in the search?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 06:51:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8349273#M90376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-22T06:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8365305#M90677</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_Waguespack&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Did you write/test this in Inventor 2019? i am on 2018, and hoping that your code will still work in 2019.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 10:29:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8365305#M90677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-29T10:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8365858#M90698</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran this in Inventor 2017... but I would expect it to run fine with 2018 or 2019 also, but I don't have those versions on this computer at the current time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think there was an update with Inventor ilogic in 2019, but I forget the specifics at the moment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe we can ask&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1649869"&gt;@Mark.Lancaster&lt;/a&gt;&amp;nbsp;to try this rule on 2019 and let us know if he sees any issue. Mark? ... if you have a spare minute. Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 14:30:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8365858#M90698</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2018-10-29T14:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8366413#M90713</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt; and &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_Waguespack&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It runs just give me a message no matching file found in C:\temp\library.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 17:34:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8366413#M90713</guid>
      <dc:creator>Mark.Lancaster</dc:creator>
      <dc:date>2018-10-29T17:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8366542#M90714</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1649869"&gt;@Mark.Lancaster&lt;/a&gt;&lt;/P&gt;&lt;P&gt;If you have time, just place a part called "test_123456.ipt" in that folder, run the rule and enter 123456 in the dialogbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:28:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8366542#M90714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-29T18:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8378745#M90984</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Of course I am thankfull to Curtis for this great help so far. If possible&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I would like to keep the original partnumber from the library piece in the new created occurence (and not the new filename). Or if not possible on creation,&amp;nbsp; modify the partnumber back to its original after placed in the assembly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;iProperties.Value("Part Number") = OriginalPartnumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 12:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8378745#M90984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-04T12:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8379678#M90991</link>
      <description>&lt;P&gt;I tried a bit, but, why isn't he finding the document?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule: Rule4, in document: Assembly1.iam&lt;/P&gt;&lt;P&gt;iProperties:The document named "U:\temp\PTN_Part_Library\PIPE\PIPE_200011.ipt" was not found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;GetInput :

Six_Digit = InputBox("Enter 6 Digit number", "iLogic", 000000)

If Six_Digit = "" Then
	Return
Else If Len(Six_Digit) &amp;lt;&amp;gt; "6" Then
MessageBox.Show("Input must be 6 digits", "ilogic")
GoTo GetInput

End If


Dim oDoc As Document
Dim sFilename As String

'hard code path
oLibrary_Folder = "U:\temp\PTN_Part_Library\"


Dim oFilenames() As String
oFilenames = System.IO.Directory.GetFiles(oLibrary_Folder, _
"*.*", SearchOption.AllDirectories)

For Each oFilename As String In oFilenames
	If oFilename.Contains(Six_Digit) Then
		Dim oOptions As Inventor.NameValueMap
		oOptions = ThisApplication.TransientObjects.CreateNameValueMap
		oDoc = ThisApplication.Documents.OpenWithOptions(oFilename, oOptions, False)
		sFilename = oFilename
		Exit For
	End If
Next

If sFilename = "" Then
	MessageBox.Show("No matching libary file found.", "iLogic")
	Return
End If

iCounter = 0

'trying to get the original partnumber&lt;BR /&gt;&lt;STRONG&gt;oOriginal_Partnumber = iProperties.Value(sFilename, "Project", "PartNumber")
MessageBox.Show(oOriginal_Partnumber)&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Nov 2018 07:01:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8379678#M90991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-05T07:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8400836#M91390</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/forums/replypage/board-id/120/message-id/90991#" target="_blank"&gt;@Curtis_Waguespack&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Curtis (or anybody), this code is just great, but would it be possible to add a line of code so the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;the original partnumber from the library piece is transfered to the new created occurence (and not the filename)? many many thanks...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports System.IO
GetInput:

Six_Digit = InputBox("Enter 6 Digit number", "iLogic", 985236 )

If Six_Digit = "" Then
	Return
Else If Len(Six_Digit) &amp;lt;&amp;gt; "6" Then
	MessageBox.Show("Input must be 6 digits", "ilogic")
	Goto GetInput

End If


Dim oDoc As Document
Dim sFilename As String

'hard code path
oLibrary_Folder = "C:\TEMP\Library\"


Dim oFilenames() As String 
oFilenames = System.IO.Directory.GetFiles(oLibrary_Folder, _ 
                      "*.*", SearchOption.AllDirectories )
					  
For Each oFilename As String In oFilenames 
	If oFilename.Contains(Six_Digit) Then
		Dim oOptions As Inventor.NameValueMap
		oOptions = ThisApplication.TransientObjects.CreateNameValueMap		
		oDoc = ThisApplication.Documents.OpenWithOptions(oFilename, oOptions, False)	
		sFilename = oFilename
		Exit For
	End If
Next 

If sFilename = "" Then
	MessageBox.Show("No matching libary file found.", "iLogic")
	Return
End If

iCounter = 0

'path from current file
'oProjectfolder = ThisDoc.Path &amp;amp; "\"

'path from current project file ( *.ipj)
oProjectfolder = _
ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath &amp;amp; "\"


Dim oProject_Filenames() As String 
oProject_Filenames = System.IO.Directory.GetFiles(oProjectfolder, _ 
                      "*.*", SearchOption.AllDirectories )
					  
'count existing project files					  
For Each oFilename As String In oProject_Filenames 
	If oFilename.Contains(Six_Digit) Then
		iCounter = iCounter + 1
	End If
Next 

'increment counter
iCounter = iCounter + 1


'find the postion of the last backslash in the path
FNamePos = InStrRev(sFilename, "\", -1)   
'get the file name with the file extension
oName = Right(sFilename, Len(sFilename) - FNamePos)
'get the file name (without extension)
ShortName = Left(oName, Len(oName) - 4)
'get extension
oExt = Right(oName, 4)


If iCounter &amp;lt; 10 Then
	iCounter = "00" + CStr(iCounter)
ElseIf iCounter &amp;lt; 100 Then
	iCounter ="0" + CStr(iCounter)
Else 
	iCounter = CStr(iCounter)
End If

oNewName = ShortName &amp;amp; "_" &amp;amp; iCounter

oPathandName = oProjectfolder &amp;amp; oNewName &amp;amp; oExt

'save new document
oDoc.SaveAs(oPathandName, True)
oDoc.Close

'[ Place Component
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

' Create Matrix
Dim oMatrix As Matrix
oMatrix = ThisApplication.TransientGeometry.CreateMatrix
Call oMatrix.SetTranslation(ThisApplication.TransientGeometry.CreateVector(50, 50, 50), True)


'insert new occurence
Dim oOcc As ComponentOccurrence
oOcc = oAsmCompDef.Occurrences.Add( _
    oPathandName, oMatrix)
	
oOcc.grounded = False	
ThisDoc.Document.SelectSet.Select(oOcc)

']

'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 09:40:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8400836#M91390</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-14T09:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Create Copies FROM Library Folder With Unique FILENAME (counter)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8412740#M91580</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_Waguespack&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The parts are always inserted at the same point 50,50,50, I suppose...&lt;/P&gt;
&lt;P&gt;Would you be so kind to have a look and tell me what I should change to insert the new part near my mouse pointer?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many Thanks, Johan&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 08:44:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-copies-to-network-library-folder-with-unique-part/m-p/8412740#M91580</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-20T08:44:19Z</dc:date>
    </item>
  </channel>
</rss>

