<?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: Create new GeoDatabase with ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/832507#M3387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the answer&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; var fGdbPath = file.DirectoryName;&lt;BR /&gt; var fGdbName = file.Name;&lt;BR /&gt; var fGdbVersion = "Current"; // create the 'latest' version of file Geodatabase&lt;BR /&gt; System.Diagnostics.Debug.WriteLine($@"create {fGdbPath} {fGdbName}");&lt;BR /&gt; var parameters = Geoprocessing.MakeValueArray&lt;BR /&gt; (fGdbPath, fGdbName, fGdbVersion);&lt;BR /&gt; var cts = new System.Threading.CancellationTokenSource();&lt;BR /&gt; var results = Geoprocessing.ExecuteToolAsync("management.CreateFileGDB", parameters, null, cts.Token,&lt;BR /&gt; (eventName, o) =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}");&lt;BR /&gt; });&lt;BR /&gt; return true;&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jul 2019 14:12:16 GMT</pubDate>
    <dc:creator>JamesKennedy1</dc:creator>
    <dc:date>2019-07-26T14:12:16Z</dc:date>
    <item>
      <title>Create new GeoDatabase with ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/832506#M3386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It looks like there is not snippet to create a GeoDatabase unless it automatically does it if it doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(dbPath)));&lt;/P&gt;&lt;P&gt;This is for opening an existing database, but if dbPath does not exist then how should I approach creating a brand new GeoDatabase?&lt;/P&gt;&lt;P&gt;I have the DirectoryName and the File Name of the geodatabase, so how do I create that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/832506#M3386</guid>
      <dc:creator>JamesKennedy1</dc:creator>
      <dc:date>2019-07-25T17:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create new GeoDatabase with ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/832507#M3387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the answer&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; var fGdbPath = file.DirectoryName;&lt;BR /&gt; var fGdbName = file.Name;&lt;BR /&gt; var fGdbVersion = "Current"; // create the 'latest' version of file Geodatabase&lt;BR /&gt; System.Diagnostics.Debug.WriteLine($@"create {fGdbPath} {fGdbName}");&lt;BR /&gt; var parameters = Geoprocessing.MakeValueArray&lt;BR /&gt; (fGdbPath, fGdbName, fGdbVersion);&lt;BR /&gt; var cts = new System.Threading.CancellationTokenSource();&lt;BR /&gt; var results = Geoprocessing.ExecuteToolAsync("management.CreateFileGDB", parameters, null, cts.Token,&lt;BR /&gt; (eventName, o) =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}");&lt;BR /&gt; });&lt;BR /&gt; return true;&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2019 14:12:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/832507#M3387</guid>
      <dc:creator>JamesKennedy1</dc:creator>
      <dc:date>2019-07-26T14:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create new GeoDatabase with ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/1011821#M5895</link>
      <description>&lt;P&gt;I found that this name for the tool works as well. Not sure if it has changed or if both will work:&amp;nbsp;CreateFileGDB_management&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 18:24:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/1011821#M5895</guid>
      <dc:creator>LesleyBross1</dc:creator>
      <dc:date>2020-12-22T18:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create new GeoDatabase with ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/1034848#M6323</link>
      <description>&lt;P&gt;see also&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-DDL" target="_blank"&gt;ProConcepts DDL · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 11:37:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/1034848#M6323</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2021-03-10T11:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create new GeoDatabase with ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/1567652#M12398</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Static routines on the&amp;nbsp;&lt;/SPAN&gt;SchemaBuilder&lt;SPAN&gt;&amp;nbsp;class called&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic72611.html" target="_blank" rel="nofollow noopener"&gt;CreateGeodatabase&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic72613.html" target="_blank" rel="nofollow noopener"&gt;DeleteGeodatabase&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;can also be used to create and delete file geodatabases. Both routines take a&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic14990.html" target="_blank" rel="nofollow noopener"&gt;FileGeodatabaseConnectionPath&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;as an argument.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It seems easier than Geoprocessing method. It basically only needs two lines of code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;FileGeodatabaseConnectionPath fileGeodatabaseConnectionPath = new FileGeodatabaseConnectionPath(uri);

// Create the file geodatabase
Geodatabase db = SchemaBuilder.CreateGeodatabase(fileGeodatabaseConnectionPath);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 04:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-new-geodatabase-with-arcgis-pro-sdk/m-p/1567652#M12398</guid>
      <dc:creator>anbinh</dc:creator>
      <dc:date>2024-12-12T04:34:47Z</dc:date>
    </item>
  </channel>
</rss>

