<?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: Need to list alll domains in a GeoDatabase (ArcGIS 10) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352615#M27652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code works.It will create a table in an SDE database - recreating it each time. Lists all the domains used in the workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;inWorkspaceString = arcpy.GetParameterAsText(0)&lt;BR /&gt;arcpy.env.workspace = inWorkspaceString&lt;BR /&gt;outTable = "OTHER_ListDomains_tbl"&lt;/P&gt;&lt;P&gt;# Delete old and Create new output table each time&lt;BR /&gt;if arcpy.Exists(outTable):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.Delete_management(outTable)&lt;BR /&gt;#&lt;BR /&gt;arcpy.CreateTable_management(inWorkspaceString, outTable)&lt;BR /&gt;arcpy.AddField_management(outTable, "DomainName", "TEXT", "", "", 255, "", "NULLABLE", "REQUIRED")&lt;BR /&gt;arcpy.AddField_management(outTable, "Versioned", "TEXT", "", "", 1, "", "NULLABLE", "NON_REQUIRED") &lt;BR /&gt;#&lt;BR /&gt;newRows = arcpy.InsertCursor(outTable, "") # Create cursor to store new rows for output table&lt;BR /&gt;arcpy.MakeTableView_management(outTable, "outTableView", "", "", "") # Create table view for output table (for searching for existing records)&lt;BR /&gt;#&lt;BR /&gt;# Create list of domains&lt;BR /&gt;desc = arcpy.Describe(inWorkspaceString)&lt;BR /&gt;domains = desc.domains&lt;BR /&gt;domains.sort() # Sorts list&lt;BR /&gt;for domain in domains:&lt;BR /&gt;# Write items from list to output table if they don't already exist there&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SelectLayerByAttribute_management("outTableView", "NEW_SELECTION", "\"DomainName\" = \'" + domain + "\'")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if int(arcpy.GetCount_management("outTableView").getOutput(0)) == 0:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newRow = newRows.newRow()&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newRow.DomainName = domain&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newRows.insertRow(newRow)&lt;BR /&gt;del newRows # Removes lock on output table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jun 2017 18:50:33 GMT</pubDate>
    <dc:creator>KarenFolger</dc:creator>
    <dc:date>2017-06-28T18:50:33Z</dc:date>
    <item>
      <title>Need to list alll domains in a GeoDatabase (ArcGIS 10)</title>
      <link>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352613#M27650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a geoprocessing tool that will bring back a list of domains within a geodatabase?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd then like to loop through a list of all the domain values.&amp;nbsp; Then I can programmatically export all domains to tables both for documentation purpose of documenting and also as a means of comparing the same domain from two different geodatabases.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 20:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352613#M27650</guid>
      <dc:creator>RandyKreuziger</dc:creator>
      <dc:date>2011-12-01T20:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need to list alll domains in a GeoDatabase (ArcGIS 10)</title>
      <link>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352614#M27651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There isn't an actual tool; however, python can access the workspace properties in order to examine the domains associated with that workspace. &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Workspace_properties/000v00000037000000/"&gt;Check out this link on the workspace properties.&lt;/A&gt;&lt;SPAN&gt; The domain property will automatically make a list object and you can use a For loop to sort through those and do whatever you need to do to the domains, such as running each domain through the Domain to Table tool. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope that helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 11:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352614#M27651</guid>
      <dc:creator>StephanieWendel</dc:creator>
      <dc:date>2011-12-02T11:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to list alll domains in a GeoDatabase (ArcGIS 10)</title>
      <link>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352615#M27652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code works.It will create a table in an SDE database - recreating it each time. Lists all the domains used in the workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;inWorkspaceString = arcpy.GetParameterAsText(0)&lt;BR /&gt;arcpy.env.workspace = inWorkspaceString&lt;BR /&gt;outTable = "OTHER_ListDomains_tbl"&lt;/P&gt;&lt;P&gt;# Delete old and Create new output table each time&lt;BR /&gt;if arcpy.Exists(outTable):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.Delete_management(outTable)&lt;BR /&gt;#&lt;BR /&gt;arcpy.CreateTable_management(inWorkspaceString, outTable)&lt;BR /&gt;arcpy.AddField_management(outTable, "DomainName", "TEXT", "", "", 255, "", "NULLABLE", "REQUIRED")&lt;BR /&gt;arcpy.AddField_management(outTable, "Versioned", "TEXT", "", "", 1, "", "NULLABLE", "NON_REQUIRED") &lt;BR /&gt;#&lt;BR /&gt;newRows = arcpy.InsertCursor(outTable, "") # Create cursor to store new rows for output table&lt;BR /&gt;arcpy.MakeTableView_management(outTable, "outTableView", "", "", "") # Create table view for output table (for searching for existing records)&lt;BR /&gt;#&lt;BR /&gt;# Create list of domains&lt;BR /&gt;desc = arcpy.Describe(inWorkspaceString)&lt;BR /&gt;domains = desc.domains&lt;BR /&gt;domains.sort() # Sorts list&lt;BR /&gt;for domain in domains:&lt;BR /&gt;# Write items from list to output table if they don't already exist there&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SelectLayerByAttribute_management("outTableView", "NEW_SELECTION", "\"DomainName\" = \'" + domain + "\'")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if int(arcpy.GetCount_management("outTableView").getOutput(0)) == 0:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newRow = newRows.newRow()&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newRow.DomainName = domain&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newRows.insertRow(newRow)&lt;BR /&gt;del newRows # Removes lock on output table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2017 18:50:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352615#M27652</guid>
      <dc:creator>KarenFolger</dc:creator>
      <dc:date>2017-06-28T18:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need to list alll domains in a GeoDatabase (ArcGIS 10)</title>
      <link>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352616#M27653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since this discussion was created in 2011,&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/listdomains.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/listdomains.htm"&gt;ListDomains—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;is probably the best way to get this information in 2017 using Python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2017 15:22:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352616#M27653</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2017-06-29T15:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need to list alll domains in a GeoDatabase (ArcGIS 10)</title>
      <link>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352617#M27654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realize this is a very old thread, but I can't recommend enough&lt;A href="http://www.arcgis.com/home/item.html?id=9ea218ff575f4a5195e01a2cae03a0ae"&gt; X-ray for ArcCatalog&lt;/A&gt; for exactly this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2017 16:00:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-list-alll-domains-in-a-geodatabase-arcgis/m-p/352617#M27654</guid>
      <dc:creator>JoshuaSchwartz</dc:creator>
      <dc:date>2017-06-29T16:00:39Z</dc:date>
    </item>
  </channel>
</rss>

