<?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: error code in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712336#M58897</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns:&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="Knipsel.JPG" style="width: 565px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/811431i21025C8421FA9955/image-size/large?v=v2&amp;amp;px=999" role="button" title="Knipsel.JPG" alt="Knipsel.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I check, that file DOES already exists, but why doesn't the search code DOESN'T finds it, after all these years of working flawlessly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: After opening that part _025.ipt itself and resave it, it's get found. This part is there for days, it is not that i placed that just before.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2020 09:08:20 GMT</pubDate>
    <dc:creator>johan.degreef</dc:creator>
    <dc:date>2020-08-26T09:08:20Z</dc:date>
    <item>
      <title>error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712270#M58889</link>
      <description>&lt;P&gt;I get a lot of these error codes lately, with this code. Does anyone sees where it comes from?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at Inventor.Document.SaveAs(String FileName, Boolean SaveCopyAs)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at ThisRule.Main()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/FONT&gt;&lt;/P&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;&lt;LI-CODE lang="general"&gt;Imports System.IO
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 = "C:\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

'path from current file
oActiveAssemblyfolder = 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 = oActiveAssemblyfolder &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)

ThisApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent,oPathandName) 
ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyPlaceComponentCmd").Execute


'oOcc.Grounded = False
'ThisDoc.Document.SelectSet.Select(oOcc)

']

'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:17:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712270#M58889</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T08:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712279#M58890</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6987528"&gt;@johan.degreef&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually when SaveAs fails for no apparent reason it's because inventor has a document with that file name in memory. You might have deleted the document in your file system but it's still kept in inventors memory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this line:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Documents&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CloseAll&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;And then run your code. It'll close all unreferenced documents in memory.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:21:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712279#M58890</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T08:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712285#M58891</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6987528"&gt;@johan.degreef&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put some messageboxes in the code an take a look till where the codes runs!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:23:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712285#M58891</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2020-08-26T08:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712293#M58892</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This did not help. Thanks anyway&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:25:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712293#M58892</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T08:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712311#M58893</link>
      <description>&lt;P&gt;Ok...&lt;BR /&gt;Since you're using ThisDoc.Path, have you saved the document in which you run the rule? Otherwise that will not return a valid path.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:30:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712311#M58893</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T08:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712316#M58894</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/473476"&gt;@bradeneuropeArthur&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the suggestion&lt;/P&gt;&lt;P&gt;After clicking OK on messagebox 6, the error appears. i do not see messagebox 7&lt;/P&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;&lt;LI-CODE lang="general"&gt;Imports System.IO
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

MessageBox.Show("Message1", "Title")


Dim oDoc As Document
Dim sFilename As String

'hard code path
oLibrary_Folder = "C:\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

MessageBox.Show("Message2", "Title")

iCounter = 0

'path from current file
oActiveAssemblyfolder = 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

MessageBox.Show("Message3", "Title")

'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)

MessageBox.Show("Message4", "Title")


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

MessageBox.Show("Message5", "Title")

oNewName = ShortName &amp;amp; "_" &amp;amp; iCounter

oPathandName = oActiveAssemblyfolder &amp;amp; oNewName &amp;amp; oExt

MessageBox.Show("Message6", "Title")

'save new document
oDoc.SaveAs(oPathandName, True)
oDoc.Close

MessageBox.Show("Message7", "Title")

'[ Place Component
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

MessageBox.Show("Message8", "Title")

' Create Matrix
Dim oMatrix As Matrix
oMatrix = ThisApplication.TransientGeometry.CreateMatrix
Call oMatrix.SetTranslation(ThisApplication.TransientGeometry.CreateVector(50, 50, 50), True)

MessageBox.Show("Message9", "Title")


'insert new occurence
'Dim oOcc As ComponentOccurrence
'oOcc = oAsmCompDef.Occurrences.Add( _
'oPathandName, oMatrix)

ThisApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent,oPathandName) 
ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyPlaceComponentCmd").Execute


'oOcc.Grounded = False
'ThisDoc.Document.SelectSet.Select(oOcc)

']

'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:34:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712316#M58894</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T08:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712318#M58895</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Ok...&lt;BR /&gt;Since you're using ThisDoc.Path, have you saved the document in which you run the rule? Otherwise that will not return a valid path.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:33:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712318#M58895</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T08:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712327#M58896</link>
      <description>&lt;P&gt;Could you have a look at oPathAndName with a msgbox to make sure it returns a valid existing path and that the file doesn't already exist?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt; :

&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter 6 Digit number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;, 000000)

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &amp;lt;&amp;gt; &lt;SPAN style="color: #008080;"&gt;"6"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Input must be 6 digits"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"ilogic"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;GoTo&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message1"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'hard code path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"C:\PTN_Part_Library\"&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;NameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Documents&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OpenWithOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;)
		&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"No matching libary file found."&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message2"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = 0

&lt;SPAN style="color: #808080;"&gt;'path from current file&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'path from current project file ( *.ipj)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt; = _
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DesignProjectManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDesignProject&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkspacePath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'count existing project files					  &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; + 1
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'increment counter&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; + 1

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message3"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'find the postion of the last backslash in the path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStrRev&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;, - 1)
&lt;SPAN style="color: #808080;"&gt;'get the file name with the file extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;) - &lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'get the file name (without extension)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;) - 4)
&lt;SPAN style="color: #808080;"&gt;'get extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, 4)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message4"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &amp;lt; 10 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"00"&lt;/SPAN&gt; + &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &amp;lt; 100 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"0"&lt;/SPAN&gt; + &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message5"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message6"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'save new document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Close&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message7"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'[ Place Component&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message8"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;' Create Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateMatrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SetTranslation&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateVector&lt;/SPAN&gt;(50, 50, 50), &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message9"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'insert new occurence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oOcc = oAsmCompDef.Occurrences.Add( _&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oPathandName, oMatrix)&lt;/SPAN&gt;

&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PostPrivateEvent&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;PrivateEventTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileNameEvent&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;) 
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ControlDefinitions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"AssemblyPlaceComponentCmd"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Execute&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'oOcc.Grounded = False&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'ThisDoc.Document.SelectSet.Select(oOcc)&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;']&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 08:41:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712327#M58896</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T08:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712336#M58897</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns:&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="Knipsel.JPG" style="width: 565px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/811431i21025C8421FA9955/image-size/large?v=v2&amp;amp;px=999" role="button" title="Knipsel.JPG" alt="Knipsel.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I check, that file DOES already exists, but why doesn't the search code DOESN'T finds it, after all these years of working flawlessly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: After opening that part _025.ipt itself and resave it, it's get found. This part is there for days, it is not that i placed that just before.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:08:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712336#M58897</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T09:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712413#M58898</link>
      <description>&lt;P&gt;Have you enabled "Show extension for known filetypes" in Explorer&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:23:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712413#M58898</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2020-08-26T09:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712418#M58899</link>
      <description>&lt;P&gt;Yes...&lt;/P&gt;&lt;P&gt;Don't tell me that this is the cause &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:25:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712418#M58899</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T09:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712429#M58900</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6987528"&gt;@johan.degreef&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd say maybe your loop to set the iCounter variable isn't that stable. It only counts how many files are in the path containing the six digits and then assumes the number should be that +1. So If there would be 5 files numbered 1,2,3,4,6 you'd get this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like your files ends with "_XXXX.ipt/iam" where XXXX is the number. I'd suggest looking at these numbers and take the highest value + 1 to make sure it's unique.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt; :

&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter 6 Digit number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;, 000000)

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &amp;lt;&amp;gt; &lt;SPAN style="color: #008080;"&gt;"6"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Input must be 6 digits"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"ilogic"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;GoTo&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message1"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'hard code path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"C:\PTN_Part_Library\"&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;NameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Documents&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OpenWithOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;)
		&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"No matching libary file found."&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message2"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = 0

&lt;SPAN style="color: #808080;"&gt;'path from current file&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'path from current project file ( *.ipj)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt; = _
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DesignProjectManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDesignProject&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkspacePath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'count existing project files					  &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;() = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Path&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFileNameWithoutExtension&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Split&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;CInt&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Length&lt;/SPAN&gt; - 1) &amp;gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;CInt&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Length&lt;/SPAN&gt; - 1)
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;



&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message3"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'find the postion of the last backslash in the path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStrRev&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;, - 1)
&lt;SPAN style="color: #808080;"&gt;'get the file name with the file extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;) - &lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'get the file name (without extension)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;) - 4)
&lt;SPAN style="color: #808080;"&gt;'get extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, 4)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message4"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &amp;lt; 10 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"00"&lt;/SPAN&gt; + &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &amp;lt; 100 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"0"&lt;/SPAN&gt; + &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message5"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message6"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'save new document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Close&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message7"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'[ Place Component&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message8"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;' Create Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateMatrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SetTranslation&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateVector&lt;/SPAN&gt;(50, 50, 50), &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message9"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'insert new occurence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oOcc = oAsmCompDef.Occurrences.Add( _&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oPathandName, oMatrix)&lt;/SPAN&gt;

&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PostPrivateEvent&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;PrivateEventTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileNameEvent&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;) 
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ControlDefinitions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"AssemblyPlaceComponentCmd"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Execute&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'oOcc.Grounded = False&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'ThisDoc.Document.SelectSet.Select(oOcc)&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;']&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:39:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712429#M58900</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T09:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712435#M58901</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might be right, because at the time of the error, there were +-24 parts of "PIPE_200213_xxx.ipt" present in the project. It seems that the numbers are not counted in a row 001, 002, 003, but rather 001, 006, 007, 009 etc. with gaps.&lt;/P&gt;&lt;P&gt;It might be the case that during the project files were deleted, because they were not needed anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you say "&lt;SPAN&gt;&amp;nbsp;It only counts how many files are in the path with containing the sig digits and then assumes the number should be that +1". i hope he count the files in the whole projectfolder - that was the intention at least.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The parts are saved in the folder where the assembly resides, so that can be all over the project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I ever wanted to correct this bit of code, i need to rely on you guys, because I have too less programming skills for that.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maybe I should wait to see if it happens again after disabling "Show extension for known filetypes" in Explorer.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712435#M58901</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T09:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712441#M58902</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6987528"&gt;@johan.degreef&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes... Sloppy written text by me. But you get the idea and I think we might have found the problem then.&lt;/P&gt;&lt;P&gt;Does the code I posted work? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:43:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712441#M58902</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T09:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712469#M58903</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your code works, but I'll check if it works when I get the error again with my old code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You did change this bit, right? he does look in all folders in the project right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'count existing project files					  
For Each oFilename As String In oProject_Filenames
	If oFilename.Contains(Six_Digit) Then
		Dim oFileNameSplit As String() = System.IO.Path.GetFileNameWithoutExtension(oFilename).Split("_")
		If CInt(oFilename.Length - 1) &amp;gt; iCounter Then iCounter = CInt(oFilename.Length - 1)
	End If
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 09:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712469#M58903</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T09:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712504#M58904</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry JhoelForshav, but I had the error again. With my code, and with your modified code. Again he came up with a number that already existed in my project and therefore failed to save it and place it in my assembly&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/473476"&gt;@bradeneuropeArthur&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "file extention" setting was also disabled, but this not solve the problem&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 10:14:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712504#M58904</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T10:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712524#M58905</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6987528"&gt;@johan.degreef&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry! I really messed that one up for some reason! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I meant to write it like this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt; :

&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter 6 Digit number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;, 000000)

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &amp;lt;&amp;gt; &lt;SPAN style="color: #008080;"&gt;"6"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Input must be 6 digits"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"ilogic"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;GoTo&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message1"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'hard code path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"C:\PTN_Part_Library\"&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;NameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Documents&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OpenWithOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;)
		&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"No matching libary file found."&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message2"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = 0

&lt;SPAN style="color: #808080;"&gt;'path from current file&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'path from current project file ( *.ipj)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt; = _
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DesignProjectManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDesignProject&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkspacePath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'count existing project files					  &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;() = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Path&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFileNameWithoutExtension&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Split&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;CInt&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Length&lt;/SPAN&gt; - 1)) &amp;gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;CInt&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Length&lt;/SPAN&gt; - 1)) + 1
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;




&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message3"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'find the postion of the last backslash in the path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStrRev&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;, - 1)
&lt;SPAN style="color: #808080;"&gt;'get the file name with the file extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;) - &lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'get the file name (without extension)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;) - 4)
&lt;SPAN style="color: #808080;"&gt;'get extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, 4)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message4"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &amp;lt; 10 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"00"&lt;/SPAN&gt; + &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &amp;lt; 100 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"0"&lt;/SPAN&gt; + &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;CStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message5"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message6"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'save new document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Close&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message7"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'[ Place Component&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message8"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;' Create Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateMatrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SetTranslation&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateVector&lt;/SPAN&gt;(50, 50, 50), &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message9"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'insert new occurence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oOcc = oAsmCompDef.Occurrences.Add( _&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oPathandName, oMatrix)&lt;/SPAN&gt;

&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PostPrivateEvent&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;PrivateEventTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileNameEvent&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;) 
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ControlDefinitions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"AssemblyPlaceComponentCmd"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Execute&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'oOcc.Grounded = False&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'ThisDoc.Document.SelectSet.Select(oOcc)&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;']&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Aug 2020 10:32:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712524#M58905</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T10:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712532#M58906</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with this code he makes this out of it: PIPE_200213_850002.ipt&lt;/P&gt;&lt;P&gt;no counter of 3 digits anymore...?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 10:36:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712532#M58906</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T10:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712551#M58907</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6987528"&gt;@johan.degreef&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This must work?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt; :

&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter 6 Digit number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;, 000000)

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &amp;lt;&amp;gt; &lt;SPAN style="color: #008080;"&gt;"6"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Input must be 6 digits"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"ilogic"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;GoTo&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;GetInput&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message1"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'hard code path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"C:\PTN_Part_Library\"&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oLibrary_Folder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;NameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Documents&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OpenWithOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;)
		&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"No matching libary file found."&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"iLogic"&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message2"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt; = 0

&lt;SPAN style="color: #808080;"&gt;'path from current file&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'path from current project file ( *.ipj)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt; = _
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DesignProjectManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDesignProject&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkspacePath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;() &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Directory&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFiles&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oProjectfolder&lt;/SPAN&gt;, _
&lt;SPAN style="color: #008080;"&gt;"*.*"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;SearchOption&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllDirectories&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'count existing project files					  &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProject_Filenames&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Six_Digit&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;() = &lt;SPAN style="color: #800000;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Path&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFileNameWithoutExtension&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFilename&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Split&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;CInt&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Length&lt;/SPAN&gt; - 1)) &amp;gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;CInt&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oFileNameSplit&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Length&lt;/SPAN&gt; - 1))
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt; += 1


&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message3"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'find the postion of the last backslash in the path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStrRev&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt;, -1)
&lt;SPAN style="color: #808080;"&gt;'get the file name with the file extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;sFilename&lt;/SPAN&gt;) -&lt;SPAN style="color: #800000;"&gt;FNamePos&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'get the file name (without extension)&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;) -4)
&lt;SPAN style="color: #808080;"&gt;'get extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oName&lt;/SPAN&gt;, 4)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message4"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)



&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message5"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;ShortName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"_"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iCounter&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"0000"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oActiveAssemblyfolder&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oNewName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oExt&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message6"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'save new document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Close&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message7"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;'[ Place Component&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message8"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;' Create Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Matrix&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateMatrix&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMatrix&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SetTranslation&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateVector&lt;/SPAN&gt;(50, 50, 50), &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;)

&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Message9"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Title"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'insert new occurence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oOcc = oAsmCompDef.Occurrences.Add( _&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oPathandName, oMatrix)&lt;/SPAN&gt;

&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PostPrivateEvent&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;PrivateEventTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileNameEvent&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oPathandName&lt;/SPAN&gt;)
&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ControlDefinitions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"AssemblyPlaceComponentCmd"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Execute&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'oOcc.Grounded = False&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'ThisDoc.Document.SelectSet.Select(oOcc)&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;']&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'MessageBox.Show("New file created: " &amp;amp; vbLf &amp;amp; oPathandName, "iLogic")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Now I format iCounter to four digits with iCounter.ToString("0000")&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 10:52:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712551#M58907</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-26T10:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: error code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712596#M58908</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, it makes&amp;nbsp;PIPE_200213_850003.ipt&lt;/P&gt;&lt;P&gt;Maybe we should replace the counter by a random generated code of +-20 digits? no duplicates then....&lt;/P&gt;&lt;P&gt;PIPE_200213_dK5p43Hes35rJ5Sxd63U.ipt&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 11:11:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-code/m-p/9712596#M58908</guid>
      <dc:creator>johan.degreef</dc:creator>
      <dc:date>2020-08-26T11:11:59Z</dc:date>
    </item>
  </channel>
</rss>

