<?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 How to get file paths for features and rasters using sdk open dialog button. in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803785#M2099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writing an add in that requires the input of several shapefiles and rasters. Unfortunately, the 'normal' open file dialog does not appropriately 'see' these file types. I need to be able to get file paths of these files without knowing the path before hand. Looking at the api reference &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic8933.html"&gt;this set of classes&lt;/A&gt; appear to be what i need. However, i am extremely new to programing in c# and am unsure how to achieve this. I have gotten as far as when button is clicked do a process##.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2020 14:38:42 GMT</pubDate>
    <dc:creator>MatthewPebworth</dc:creator>
    <dc:date>2020-08-12T14:38:42Z</dc:date>
    <item>
      <title>How to get file paths for features and rasters using sdk open dialog button.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803785#M2099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writing an add in that requires the input of several shapefiles and rasters. Unfortunately, the 'normal' open file dialog does not appropriately 'see' these file types. I need to be able to get file paths of these files without knowing the path before hand. Looking at the api reference &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic8933.html"&gt;this set of classes&lt;/A&gt; appear to be what i need. However, i am extremely new to programing in c# and am unsure how to achieve this. I have gotten as far as when button is clicked do a process##.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2020 14:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803785#M2099</guid>
      <dc:creator>MatthewPebworth</dc:creator>
      <dc:date>2020-08-12T14:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get file paths for features and rasters using sdk open dialog button.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803786#M2100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matthew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the BrowseProjectFilters and OpenItemDialog class to achieve what you need.&lt;/P&gt;&lt;P&gt;Pro offers a collection of existing BrowseProjectFilters that you can use. For example,&amp;nbsp;"&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;esri_browseDialogFilters_shapefiles" will allow you to browse just for shape files.&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Note:&lt;/STRONG&gt; You can also make your own filters for other file types.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;Here is a rough workflow:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;Create a BrowseProjectFilter instance. You can instantiate it with one of the existing Pro filters (Shape file filter listed above is an example).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;Create an OpenItemDialog object and set its "BrowseFilter" property to the&amp;nbsp;&lt;SPAN&gt;BrowseProjectFilter&amp;nbsp;instance created (above).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;Call the Show method on the OpenItemDialog to display the dialog, filtering for the file types.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;Here are some wiki pages that can help you:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;All Pro existing BrowseProjectFilters are listed here:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Browse-Dialog-Filters"&gt;ProSnippets: Browse Dialog Filters&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;A Guide that gives you examples of a complete workflow in creating OpenItemDialog with Browse filters:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Custom-Browse-Dialog-Filters"&gt;ProGuide: Custom Browse Dialog Filters&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;Concept docs that explains how filters work in Pro:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Content-and-Items#browse-dialog-filters"&gt;Browse Dialog Filters&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;Uma&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2020 21:48:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803786#M2100</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2020-08-12T21:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get file paths for features and rasters using sdk open dialog button.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803787#M2101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. The magic bullet for me was the need for the framework dispatcher property. This is what i was needing for future people in the same spot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var dlg = new OpenItemDialog();&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; dlg.Title = "Select DEM Raster";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp; FrameworkApplication.Current.Dispatcher.Invoke(() =&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result = dlg.ShowDialog();&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!dlg.ShowDialog().Value)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var SelFile = dlg.Items.First();&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///Verify expected outcome&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// MessageBox.Show($@"Path: {SelFile.Path}");&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPath = SelFile.Path;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName = System.IO.Path.GetFileName(SelFile.Path);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtDEM.Text = FileName;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2020 15:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-file-paths-for-features-and-rasters/m-p/803787#M2101</guid>
      <dc:creator>MatthewPebworth</dc:creator>
      <dc:date>2020-08-20T15:00:06Z</dc:date>
    </item>
  </channel>
</rss>

