<?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: File name split into part number, description, vendor in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7321284#M266303</link>
    <description>&lt;P&gt;I'm going to use your first solution. &amp;nbsp;The solution with the purchased part i'm nog going to use it. &amp;nbsp;But thanks al lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a second question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Our files have the following name: "xxxx-yy-z_name"&lt;/SPAN&gt;&lt;BR /&gt;And we have populated the filename in to:&lt;BR /&gt;&lt;SPAN&gt;Part_Number: "xxxx-yy-z"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: "name"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now i want to populate "XXXX" and YY of the filename (or part number) into 2 custom properties lets say "Nr" and "Pos"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to have:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Part_Number: "xxxx-yy-z" &amp;nbsp;(ipropertie)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: "name" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(ipropertie)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nr: "xxxx" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (custom propertie)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pos: &amp;nbsp;"yy" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(custom propertie)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can we do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2017 09:00:37 GMT</pubDate>
    <dc:creator>stefan.godfroid</dc:creator>
    <dc:date>2017-08-23T09:00:37Z</dc:date>
    <item>
      <title>File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315687#M266295</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have 2 types of file names:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type 1: (parts and assembly's)&lt;BR /&gt;Our files have the following name: "xxxx-yy-z_name"&lt;BR /&gt;How can I split this name into Part_number and Discription (Iproperties)?&lt;BR /&gt;Part_Number: "xxxx-yy-z"&lt;BR /&gt;Description: "name"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type 2: (purchased parts and assembly's)&lt;BR /&gt;"Festo_dfm-16-50-ppv-a"&lt;BR /&gt;Splitting into:&lt;BR /&gt;Vendor: Festo&lt;BR /&gt;Part number: dfm-16-50-ppv-a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you do that in I-logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yours sincerely&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 11:44:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315687#M266295</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-21T11:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315780#M266296</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should do it for Type 1..&lt;/P&gt;
&lt;P&gt;I'll update it to to both requirements in a minute..&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim FileName, PartNumber, Description As String
Dim UnderPos As Long
FileName = ThisDoc.FileName(False)

'Search the "(" position in string
UnderPos = InStrRev(FileName, "_", - 1)
If UnderPos = 0 Then
MessageBox.Show("No underscore character found", "ILogic")
Return
End If

PartNumber = Left(FileName, UnderPos - 1)
MessageBox.Show(PartNumber, "Part Number")
iProperties.Value("Project", "Part Number") = PartNumber


Description = Left(FileName, Len(FileName))
Description = Right(Description, Len(Description) - UnderPos)
MessageBox.Show(Description, "Description")
iProperties.Value("Project", "Description") = Description&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315780#M266296</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2017-08-21T12:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315824#M266297</link>
      <description>&lt;P&gt;Ok this should cover both your needs..&lt;/P&gt;
&lt;PRE&gt;Dim FileName, PartNumber, Description, Vendor As String
Dim UnderPos As Long
FileName = ThisDoc.FileName(False)

'Search the "(" position in string
UnderPos = InStrRev(FileName, "_", - 1)
If UnderPos = 0 Then
MessageBox.Show("No underscore character found", "ILogic")
Return
End If

Dim oDoc As Document = ThisApplication.ActiveDocument
oStruct = oDoc.ComponentDefinition.BOMStructure
MessageBox.Show(oStruct, "Title")

If oStruct = 51973 Then
Vendor = Left(FileName, UnderPos - 1)
MessageBox.Show(Vendor, "Vendor")
iProperties.Value("Project", "Vendor") = Vendor
PartNumber = Left(FileName, Len(FileName))
PartNumber = Right(PartNumber, Len(PartNumber) - UnderPos)
MessageBox.Show(PartNumber, "Part Number")
iProperties.Value("Project", "Part Number") = PartNumber
Else
PartNumber = Left(FileName, UnderPos - 1)
MessageBox.Show(PartNumber, "Part Number")
iProperties.Value("Project", "Part Number") = PartNumber
Description = Left(FileName, Len(FileName))
Description = Right(Description, Len(Description) - UnderPos)
MessageBox.Show(Description, "Description")
iProperties.Value("Project", "Description") = Description
End If&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:34:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315824#M266297</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2017-08-21T12:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315828#M266298</link>
      <description>&lt;P&gt;Thank you for the response&lt;BR /&gt;What event can I start the rule?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:36:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315828#M266298</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-21T12:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315839#M266299</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for the response&lt;BR /&gt;What event can I start the rule?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Before save would be good..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:41:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315839#M266299</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2017-08-21T12:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315856#M266300</link>
      <description>&lt;P&gt;The rule does not work.&lt;BR /&gt;I used the rule from your first answer as a test.&lt;BR /&gt;If I give a name xxxx-yy-z_name then I get the error "No underscore character found". However, I have _ in the filename.&lt;BR /&gt;The iproperties are also not filled in correctly. Only under part number is the file name.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:47:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315856#M266300</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-21T12:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315910#M266301</link>
      <description>&lt;P&gt;Now it works! &amp;nbsp;(your first solution). &amp;nbsp;I replaced your _ with mine _. &amp;nbsp;It is the same, i know but I think the reason is that I'm working with an azerty keyboard.&lt;/P&gt;&lt;P&gt;And second, i used the trigger event "after save document".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i'm going to test your second solution. &amp;nbsp;So it works with purchased parts.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 13:10:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7315910#M266301</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-21T13:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7316138#M266302</link>
      <description>&lt;P&gt;I am a bit late to the party but I only have one speed .... really slow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have given your problem a try and wrote a code which you can run from the assembly and it should change all parts ... but I haven't test it that much really.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so run this from your assembly and it should change all components.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;'define the active assembly
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument 

Dim oFullFileName As String
Dim oDoc As Inventor.Document
Dim oPropSet As PropertySet


For Each oDoc In oAsmDoc.AllReferencedDocuments
	oPropSet = oDoc.PropertySets.Item("Design Tracking Properties")
	
	oFullFileName = oDoc.FullFileName
	'find the postion of the last backslash in the path
	FNamePos = InStrRev(oFullFileName, "\", -1)   
	'get the file name with the file extension
	Name = Right(oFullFileName, Len(oFullFileName) - FNamePos)
	'get the file name (without extension)
	ShortName = Left(Name, Len(Name) - 4)
	
	If oDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure Then
		VendorPos = InStrRev(ShortName, "_", -1)
		Vendor = Left(ShortName, (VendorPos-1))
		PartNumber = Right(ShortName, (Len(ShortName)-VendorPos))

		oPropSet.Item("Vendor").Value = Vendor
		oPropSet.Item("Part Number").Value = PartNumber
	Else 
		PartNumberPos = InStrRev(ShortName, "_", -1)
		PartNumber = Left(ShortName, (PartNumberPos-1))
		Description = Right(ShortName, (Len(ShortName)-PartNumberPos))

		oPropSet.Item("Description").Value = Description
		oPropSet.Item("Part Number").Value = PartNumber
		
	End If

Next&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Aug 2017 14:20:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7316138#M266302</guid>
      <dc:creator>salariua</dc:creator>
      <dc:date>2017-08-21T14:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7321284#M266303</link>
      <description>&lt;P&gt;I'm going to use your first solution. &amp;nbsp;The solution with the purchased part i'm nog going to use it. &amp;nbsp;But thanks al lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a second question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Our files have the following name: "xxxx-yy-z_name"&lt;/SPAN&gt;&lt;BR /&gt;And we have populated the filename in to:&lt;BR /&gt;&lt;SPAN&gt;Part_Number: "xxxx-yy-z"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: "name"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now i want to populate "XXXX" and YY of the filename (or part number) into 2 custom properties lets say "Nr" and "Pos"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to have:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Part_Number: "xxxx-yy-z" &amp;nbsp;(ipropertie)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: "name" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(ipropertie)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nr: "xxxx" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (custom propertie)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pos: &amp;nbsp;"yy" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(custom propertie)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can we do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 09:00:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7321284#M266303</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-23T09:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322090#M266304</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I'm going to use your first solution. &amp;nbsp;The solution with the purchased part i'm nog going to use it. &amp;nbsp;But thanks al lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a second question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Our files have the following name: "xxxx-yy-z_name"&lt;/SPAN&gt;&lt;BR /&gt;And we have populated the filename in to:&lt;BR /&gt;&lt;SPAN&gt;Part_Number: "xxxx-yy-z"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: "name"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now i want to populate "XXXX" and YY of the filename (or part number) into 2 custom properties lets say "Nr" and "Pos"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to have:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Part_Number: "xxxx-yy-z" &amp;nbsp;(ipropertie)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: "name" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(ipropertie)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nr: "xxxx" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (custom propertie)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Pos: &amp;nbsp;"yy" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(custom propertie)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can we do that?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Before we spend time on that are you going to have more requests like these?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its best to just tell us everything at one time.. So we don't have to rewrite code over again..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried to understand the code written above to see if you can accomplish this by yourself?&lt;/P&gt;
&lt;P&gt;salariua left the comments in the code he provided.. comments start with '&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 13:26:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322090#M266304</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2017-08-23T13:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322127#M266305</link>
      <description>&lt;P&gt;My knowledge for I-logic is still very minimal.&lt;BR /&gt;Therefore the question.&lt;BR /&gt;Already, I'm learning.&lt;/P&gt;&lt;P&gt;Apart from my last question, there will be no other questions.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 13:33:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322127#M266305</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-23T13:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322289#M266306</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;One last thing.. Will it always be xxxx-yy-z_name&lt;/P&gt;
&lt;P&gt;So always 4 digits in the x or will it ever be xxxxx-yyy-zzz_name or similar&lt;/P&gt;
&lt;P&gt;Will the x parts always be 4 digits and y parts always 2 and z always 1 then name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 14:10:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322289#M266306</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2017-08-23T14:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322308#M266307</link>
      <description>&lt;P&gt;Yes, &amp;nbsp;allways 4 digits XXXX and &amp;nbsp;2 digits YY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 14:14:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322308#M266307</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-23T14:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322353#M266308</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes, &amp;nbsp;allways 4 digits XXXX and &amp;nbsp;2 digits YY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;How about this..&lt;/P&gt;
&lt;P&gt;as simple to understand as I could make it.. should work&lt;/P&gt;
&lt;PRE&gt;'Split xxxx-yy-z_name
'into the following
'part Number: xxxx-yy-z
'description:name
'Custom NR:xxxx
'Custom POS:yy

''define your strings
Dim FileName, PartNumber, Description, NR, oPOS, POS As String
'get the filename to start it all
FileName = ThisDoc.FileName(False)

'assign all our variables a value
'select the first 9 digits starting from the LEFT of the filename and set the partnumber variable to that
PartNumber = Left(FileName, 9)

'select the first 4 digits starting from the RIGHT of the filename and set the description variable to that
Description = Right(Filename, 4)

'select the first 4 digits starting from the LEFT of the filename and set the NR variable to that
NR = Left(FileName, 4)

'select the first 4 digits starting from the RIGHT of the part number and set the oPOS variable to that.. doing this to get rid of the z
oPOS = Right(PartNumber, 4)

'select the first 2 digits starting from the LEFT of the oPOS variable and set the POS variable to that
POS = Left(oPOS, 2)



'now lets set all of our iproperties


'set the part number iproperty to the partnumber variable we just created
iProperties.Value("Project", "Part Number") = PartNumber

'set the description iproperty to the description variable we just created
iProperties.Value("Project", "Description") = Description

'set the custom NR iproperty to the NR variable we just created
iProperties.Value("Custom", "NR") = NR

'set the custom POS iproperty to teh POS variable we just created
iProperties.Value("Custom", "POS") = POS&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Aug 2017 14:24:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7322353#M266308</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2017-08-23T14:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7323115#M266309</link>
      <description>&lt;P&gt;Thanks! &amp;nbsp;I test it tomorow!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 17:59:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/7323115#M266309</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2017-08-23T17:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/9098009#M266310</link>
      <description>&lt;P&gt;It works great.&lt;/P&gt;&lt;P&gt;Now i have another question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a custom parameter "TEKENINGCODE".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the "TEKENINGCODE"= K.&amp;nbsp; Then we have to split the filename in to 2 pieces.&amp;nbsp; Everything before "_" must be filled in the custom parameter "FABRIKANT".&amp;nbsp; And every thing after "_" must be filled in into the parameter "Part number".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in other cases, then the parameters must be filled like the original I-logic code&amp;nbsp;as mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can it be done?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 08:26:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/9098009#M266310</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2019-10-21T08:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/9098436#M266311</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5002718"&gt;@stefan.godfroid&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It works great.&lt;/P&gt;
&lt;P&gt;Now i have another question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a custom parameter "TEKENINGCODE".&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the "TEKENINGCODE"= K.&amp;nbsp; Then we have to split the filename in to 2 pieces.&amp;nbsp; Everything before "_" must be filled in the custom parameter "FABRIKANT".&amp;nbsp; And every thing after "_" must be filled in into the parameter "Part number".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in other cases, then the parameters must be filled like the original I-logic code&amp;nbsp;as mentioned above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can it be done?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is this what you are asking about?&lt;/P&gt;
&lt;PRE&gt;''define your strings
Dim FileName, PartNumber, Description, NR, oPOS, POS, FABRIKANT As String

'If TEKENINGCODE is K then do the following..
If iProperties.Value("Custom", "TEKENINGCODE") = "K" Then
	'get the filename to start it all
	FileName = ThisDoc.FileName(False)

	'assign all our variables a value
	'select the first 9 digits starting from the LEFT of the filename and set the partnumber variable to that
	PartNumber = Left(FileName, 9)

	'select the first 4 digits starting from the RIGHT of the filename and set the description variable to that
	FABRIKANT = Right(FileName, 4)

	'set the custom POS iproperty to teh POS variable we just created
	iProperties.Value("Custom", "FABRIKANT") = FABRIKANT

'If TEKENINGCODE is not K then do the following..
Else

		'Split xxxx-yy-z_name
		'into the following
		'part Number: xxxx-yy-z
		'description:name
		'Custom NR:xxxx
		'Custom POS:yy

	'get the filename to start it all
	FileName = ThisDoc.FileName(False)

	'assign all our variables a value
	'select the first 9 digits starting from the LEFT of the filename and set the partnumber variable to that
	PartNumber = Left(FileName, 9)

	'select the first 4 digits starting from the RIGHT of the filename and set the description variable to that
	Description = Right(FileName, 4)

	'select the first 4 digits starting from the LEFT of the filename and set the NR variable to that
	NR = Left(FileName, 4)

	'select the first 4 digits starting from the RIGHT of the part number and set the oPOS variable to that.. doing this to get rid of the z
	oPOS = Right(PartNumber, 4)

	'select the first 2 digits starting from the LEFT of the oPOS variable and set the POS variable to that
	POS = Left(oPOS, 2)



	'now lets set all of our iproperties


	'set the part number iproperty to the partnumber variable we just created
	iProperties.Value("Project", "Part Number") = PartNumber

	'set the description iproperty to the description variable we just created
	iProperties.Value("Project", "Description") = Description

	'set the custom NR iproperty to the NR variable we just created
	iProperties.Value("Custom", "NR") = NR

	'set the custom POS iproperty to teh POS variable we just created
	iProperties.Value("Custom", "POS") = POS

End If&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2019 12:32:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/9098436#M266311</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2019-10-21T12:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: File name split into part number, description, vendor</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/9102723#M266312</link>
      <description>&lt;P&gt;Oops, sorry to mention:&lt;BR /&gt;In case the user parameter TEKENINGCODE = K:&lt;BR /&gt;The filename can than be different: The number of characters in the name can be arbitrary. It can eg XXXX_YYYYYY or XXXXXX_YYYYY or XXX_YY-YYYY-YYYY etc ...&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 08:37:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/file-name-split-into-part-number-description-vendor/m-p/9102723#M266312</guid>
      <dc:creator>stefan.godfroid</dc:creator>
      <dc:date>2019-10-23T08:37:53Z</dc:date>
    </item>
  </channel>
</rss>

