<?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: Check if file exists in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247635#M6411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, problems are solved, thanks a lot Bruce!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. gp.Exists works nicely&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim dt As Object = ""
Dim bExists As Boolean = gp.Exists(path, dt)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. GPUtilities class has AddToMap function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
Dim pGPUtil As IGPUtilities
Dim pDataElement As IDataElement

pGPUtil = New GPUtilities

' Add a rasterdataset to the map
pDataElement = New DERasterDataset
pDataElement.CatalogPath = path
pGPUtil.AddToMap(pDataElement, "", False, Nothing)

' Add a featureclass to the map
pDataElement = New DEFeatureClass
pDataElement.CatalogPath = path
pGPUtil.AddToMap(pDataElement, "", False, Nothing)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:19:45 GMT</pubDate>
    <dc:creator>StanStas</dc:creator>
    <dc:date>2021-12-11T12:19:45Z</dc:date>
    <item>
      <title>Check if file exists</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247633#M6409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;have 2 parts question. I've file path loaded into textbox by user... I don't know what data type it is (File, mdb or shapefile.. vector or raster...). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I'd like to check if that file path exists. I can use System.IO.File.Exists, but it works only for shapefiles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I'd like to add that file into ArcMap if it is possible. I know how to do this with File geodatabase, but again - I don't know what data type it is &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/67004-Get-Data-Type-from-Path?highlight=path" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/67004-Get-Data-Type-from-Path?highlight=path&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2012 23:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247633#M6409</guid>
      <dc:creator>StanStas</dc:creator>
      <dc:date>2012-11-06T23:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Check if file exists</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247634#M6410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1. Have you tried the Exists geoprocessing tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Take a look at some of the 'Open...' methods available in the GPUtilities class&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 13:50:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247634#M6410</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2012-11-07T13:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Check if file exists</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247635#M6411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, problems are solved, thanks a lot Bruce!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. gp.Exists works nicely&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim dt As Object = ""
Dim bExists As Boolean = gp.Exists(path, dt)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. GPUtilities class has AddToMap function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
Dim pGPUtil As IGPUtilities
Dim pDataElement As IDataElement

pGPUtil = New GPUtilities

' Add a rasterdataset to the map
pDataElement = New DERasterDataset
pDataElement.CatalogPath = path
pGPUtil.AddToMap(pDataElement, "", False, Nothing)

' Add a featureclass to the map
pDataElement = New DEFeatureClass
pDataElement.CatalogPath = path
pGPUtil.AddToMap(pDataElement, "", False, Nothing)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/check-if-file-exists/m-p/247635#M6411</guid>
      <dc:creator>StanStas</dc:creator>
      <dc:date>2021-12-11T12:19:45Z</dc:date>
    </item>
  </channel>
</rss>

