<?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: iLogic to return specific folder in a path in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335749#M98411</link>
    <description>&lt;P&gt;the following code splits the folderpath in sepparated strings. From there you can get the folder names that you need&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'get the full file name of the this document
Dim folderpath As String = ThisDoc.PathAndFileName(False)

'split the "full file name" in folder foldernames
Dim folders As String() = folderpath.split("\")

'get the data you are looking for.
'Pay attension that ilogic start counting by 0
'C:/WF/Designs/CUSTOMER/ORDERNO/FRAMEGENERATOR/FRAME
'0  1    2        3        4          5          6
Dim Customer As String = folders(3)
Dim Orderno As String = folders(4)

iProperties.Value("Project", "Description") = Customer + " - " + Orderno&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Aug 2017 12:30:38 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2017-08-29T12:30:38Z</dc:date>
    <item>
      <title>iLogic to return specific folder in a path</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335529#M98409</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know if there is a way to make iLogic return say folder no. 4 of a file that is 6 folders down in the tree?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I'm using folderpath, but that returns the folder of the file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My folder tree works like this:&lt;BR /&gt;&lt;BR /&gt;C:/WF/Designs/CUSTOMER/ORDERNO/FRAMEGENERATOR/FRAME&lt;BR /&gt;&lt;BR /&gt;I would like to return Customer and Orderno and write it to a custom iProperty.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With my current setup, it naturally returns FRAMEGENERATOR and FRAME for frame generator parts&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I know what isn't possible:&lt;BR /&gt;&lt;BR /&gt;It isn't possible to cover everything by no. of characters from the start&lt;BR /&gt;It isn't possible to cover everything by no. of characters from the end.&lt;/P&gt;
&lt;P&gt;It isn't possible to cover everything by parent folders, since frame parts won't return the proper names, then.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 11:07:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335529#M98409</guid>
      <dc:creator>YannickEnrico</dc:creator>
      <dc:date>2017-08-29T11:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic to return specific folder in a path</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335697#M98410</link>
      <description>&lt;P&gt;It would appear I figured it out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks anyhow!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;'get filepath
filePath = ThisDoc.Path
'separate into array by directory separator
filePathArray = Split(filePath, System.IO.Path.DirectorySeparatorChar)

'C=0, WF=1, Designs=2, Customer=3, OrderNo=4
filePathOrderNo = filePathArray(4)
filePathCustomer = filePathArray(3)

iProperties.Value("Custom", "Ordrenummer")=filePathOrderNo
iProperties.Value("Project", "Project")=filePathCustomer&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 12:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335697#M98410</guid>
      <dc:creator>YannickEnrico</dc:creator>
      <dc:date>2017-08-29T12:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic to return specific folder in a path</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335749#M98411</link>
      <description>&lt;P&gt;the following code splits the folderpath in sepparated strings. From there you can get the folder names that you need&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'get the full file name of the this document
Dim folderpath As String = ThisDoc.PathAndFileName(False)

'split the "full file name" in folder foldernames
Dim folders As String() = folderpath.split("\")

'get the data you are looking for.
'Pay attension that ilogic start counting by 0
'C:/WF/Designs/CUSTOMER/ORDERNO/FRAMEGENERATOR/FRAME
'0  1    2        3        4          5          6
Dim Customer As String = folders(3)
Dim Orderno As String = folders(4)

iProperties.Value("Project", "Description") = Customer + " - " + Orderno&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 12:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-to-return-specific-folder-in-a-path/m-p/7335749#M98411</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2017-08-29T12:30:38Z</dc:date>
    </item>
  </channel>
</rss>

