<?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: How to add geodatabase to aprx with arcpy? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1518316#M86774</link>
    <description>&lt;P&gt;Sorry,&lt;/P&gt;&lt;P&gt;I missed the method arcpy.mp.ArcGISProject.updateDatabases(databases, {validate})&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2024 13:07:02 GMT</pubDate>
    <dc:creator>JörgEbert</dc:creator>
    <dc:date>2024-08-12T13:07:02Z</dc:date>
    <item>
      <title>How to add geodatabase to aprx with arcpy?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1518304#M86772</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a script tool and I want to add the output file geodatabase from my script to aprx databases. But arcpy.mp.ArcGISProject.databases is a read-only property.&lt;/P&gt;&lt;P&gt;Is there a way with arcpy or via CIM or calling ArcGIS Pro SDK in arcpy?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 12:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1518304#M86772</guid>
      <dc:creator>JörgEbert</dc:creator>
      <dc:date>2024-08-12T12:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add geodatabase to aprx with arcpy?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1518316#M86774</link>
      <description>&lt;P&gt;Sorry,&lt;/P&gt;&lt;P&gt;I missed the method arcpy.mp.ArcGISProject.updateDatabases(databases, {validate})&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 13:07:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1518316#M86774</guid>
      <dc:creator>JörgEbert</dc:creator>
      <dc:date>2024-08-12T13:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add geodatabase to aprx with arcpy?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1533935#M87857</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm struggling at the same step. I "just" want to add my gdb to my current project.&lt;BR /&gt;&lt;BR /&gt;I do not find the documentation on it. I tried your example but I'm missing one parameters&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gdb = r"*\MyGDB.gdb"
arcpy.env.workspace = gdb

arcpy.mp.ArcGISProject.updateDatabases(gdb)
aprx.save()
del aprx&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But I get:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;                                 Traceback (most recent call last)
&lt;SPAN class=""&gt;      6&lt;/SPAN&gt; arcpy&lt;SPAN class=""&gt;.&lt;/SPAN&gt;env&lt;SPAN class=""&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class=""&gt;=&lt;/SPAN&gt; gdb
&lt;SPAN class=""&gt;      7&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;----&amp;gt; 8&lt;/SPAN&gt; arcpy&lt;SPAN class=""&gt;.&lt;/SPAN&gt;mp&lt;SPAN class=""&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class=""&gt;.&lt;/SPAN&gt;updateDatabases&lt;SPAN class=""&gt;(&lt;/SPAN&gt;gdb&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      9&lt;/SPAN&gt; aprx&lt;SPAN class=""&gt;.&lt;/SPAN&gt;save&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;     10&lt;/SPAN&gt; &lt;SPAN class=""&gt;del&lt;/SPAN&gt; aprx

&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;: updateDatabases() missing 1 required positional argument: 'databases'

&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Can you give a code example with parameters ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Sep 2024 19:15:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1533935#M87857</guid>
      <dc:creator>Alex_gis</dc:creator>
      <dc:date>2024-09-01T19:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add geodatabase to aprx with arcpy?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1534003#M87864</link>
      <description>&lt;P&gt;Sorry,&lt;BR /&gt;the database parameter of the updateDatabases method requires a list of Python dictionaries, but not a string/path of a geodatabase. This is well documented &lt;A href="https://pro.arcgis.com/de/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject('Current')&lt;BR /&gt;gdbs = aprx.databases&lt;BR /&gt;# change the list of Python dictionaries&lt;BR /&gt;# gdbs.append({'databasePath': '&amp;lt;A local or UNC path to a database&amp;gt;', 'isDefaultDatabase': False})&lt;BR /&gt;aprx.updateDatabases(gdbs)&lt;BR /&gt;aprx.save()&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 07:17:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-add-geodatabase-to-aprx-with-arcpy/m-p/1534003#M87864</guid>
      <dc:creator>JörgEbert</dc:creator>
      <dc:date>2024-09-02T07:17:17Z</dc:date>
    </item>
  </channel>
</rss>

