<?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: List of a Vault folder's contents in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7636108#M6751</link>
    <description>&lt;P&gt;Thank you very much, Erik!&amp;nbsp; That worked great.&lt;BR /&gt;&lt;BR /&gt;For anyone who might find this and be using VB.NET, the similar LINQ expressions portion would be like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Dim filenames As List(Of String) = Nothing

'(All files in folder)
filenames = fileArray.[Select](Function(x) x.Name).ToList

'(IDW's only)
filenames = fileArray.Where(Function(y) y.FileClass = ACW.FileClassification.DesignDocument).[Select](Function(x) x.Name).ToList&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;--Jeff&lt;/P&gt;</description>
    <pubDate>Tue, 19 Dec 2017 18:43:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-12-19T18:43:27Z</dc:date>
    <item>
      <title>List of a Vault folder's contents</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7626017#M6749</link>
      <description>&lt;P&gt;Hi folks.&amp;nbsp; What is the best way to get a list of the files which reside within a specified Vault folder?&lt;BR /&gt;&lt;BR /&gt;Ideally, I'd like to be able to limit it to just ".idw" files, but all the files would be a good start.&lt;BR /&gt;&lt;BR /&gt;I have been trying some rather convoluted mechanisms which are not working out for me and feel like they are probably unnecessarily complex.&lt;BR /&gt;&lt;BR /&gt;It seems like there would be a rather straight-forward way to get a listing of a folder's contents.&amp;nbsp; Just a list of strings would be fine - or File objects or whatever.&amp;nbsp; Thanks!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;--Jeff&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 07:25:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7626017#M6749</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T07:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: List of a Vault folder's contents</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7634544#M6750</link>
      <description>&lt;P&gt;Hello, that does not seem to be a big deal in the Vault SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;public List&amp;lt;String&amp;gt; getFilesInVaultFolder(DocumentService _docServ, String _folderPath)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Folder searchFolder = _docServ.GetFolderByPath(_folderPath);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File[] fileArray = _docServ.GetLatestFilesByFolderId(searchFolder.Id, true);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;String&amp;gt; fileNames = fileArray.Select(x =&amp;gt; x.Name).ToList();&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fileNames;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If you only use IDW and not IPN or Inventor DWG, you could use &lt;/P&gt;
&lt;PRE&gt;  public List&amp;lt;String&amp;gt; getFilesInVaultFolder(DocumentService _docServ, String _folderPath)
        {


            Folder searchFolder = _docServ.GetFolderByPath(_folderPath);

            File[] fileArray = _docServ.GetLatestFilesByFolderId(searchFolder.Id, true);

            List&amp;lt;String&amp;gt; fileNames = fileArray.Where(y=&amp;gt;y.FileClass == FileClassification.DesignDocument).Select(x =&amp;gt; x.Name).ToList();

            return fileNames;

        }&lt;/PRE&gt;
&lt;P&gt;to only get the IDWs. Otherwise it is a bit more tricky and involves either the PropertyService or you need a search with FindFilesBySearchCondition().&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 10:20:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7634544#M6750</guid>
      <dc:creator>gilsdorf_e</dc:creator>
      <dc:date>2017-12-19T10:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: List of a Vault folder's contents</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7636108#M6751</link>
      <description>&lt;P&gt;Thank you very much, Erik!&amp;nbsp; That worked great.&lt;BR /&gt;&lt;BR /&gt;For anyone who might find this and be using VB.NET, the similar LINQ expressions portion would be like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Dim filenames As List(Of String) = Nothing

'(All files in folder)
filenames = fileArray.[Select](Function(x) x.Name).ToList

'(IDW's only)
filenames = fileArray.Where(Function(y) y.FileClass = ACW.FileClassification.DesignDocument).[Select](Function(x) x.Name).ToList&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;--Jeff&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 18:43:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/7636108#M6751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-19T18:43:27Z</dc:date>
    </item>
    <item>
      <title>Betreff: List of a Vault folder's contents</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/11116884#M6752</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also get the information to excel without the need of using any code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) In Vault: open folder of interest&lt;/P&gt;&lt;P&gt;2) Select column(s) of interest&lt;/P&gt;&lt;P&gt;3) Press Ctrl+c&lt;/P&gt;&lt;P&gt;4) Open an excel sheet and press Ctrl+v&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 14:35:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/list-of-a-vault-folder-s-contents/m-p/11116884#M6752</guid>
      <dc:creator>i.rudd</dc:creator>
      <dc:date>2022-04-20T14:35:48Z</dc:date>
    </item>
  </channel>
</rss>

