Sorting a Coded-Value Domain Add-In (ArcGIS 10)

I am working on an data-entry application to edit feature classes that contain several coded-value-domains. The problem with some of the domains, however, is that some entries have been added after the initial creation.  So the first 25 entries are in alphabetical order and there are some stragglers at the end that are in the order they were appended.

This can be confusing for users–they go to select “Milli Vanilli” and look between “Madonna” and “Motley Crue” but can not find their favorite band there–they have to go to the end of the list to find their selection.

In the past, I have gone through the tedious process of exporting the domain to a table, sorting the table, removing the domain from the necessary field(s), deleting the domain, re-importing the table back in a new domain and finally re-applying the domain to the necessary field(s). Let’s just say I didn’t do this until someone asked a few times and I didn’t have anything more exciting–like a root canal–I could busy myself with.

But this new application contains more domains than any of other datasets so it was time to find a better solution. ESRI does have a Domain Sort Developer Sample.  It, however, did not play nice with ArcGIS 10.

So I went ahead and update it from VB 6 to VB.Net/ArcObjects 10.  I made an Add-In that can be installed by downloading the .esriaddin file and double-clicking on it.  The source code is also available.

This will add an ArcCatalog Toolbar that can be added by going to Customize-Toolbars-Domain Sorter Toolbar.

This will add a toolbar with one button.  The button enables whenever you select a geodatabase with at least one coded-value domain.

This brings up a Windows form that lets you sort any domain by either the code or description, ascending or descending.  Once you hit “OK” it re-sorts your domain.

The only problem I have had is that only the owner of a domain is allowed to edit it on an SDE geodatabase.

But other than that, the button allows you to easily keep your domains sorted.

http://edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Geodatabase/Schema_Creation_and_Management/Sort_a_domain/e826c5a8-9740-4f0b-86b6-d3b834735574.htm

Advertisements

10 thoughts on “Sorting a Coded-Value Domain Add-In (ArcGIS 10)

  1. Very cool, I’ll have to give your code a try. I have used the Table To Domain tool within toolbox with the REPLACE option to replace an existing domain rather than the tedious process you described, but if your tool does it without the whole export process, that will rock!

  2. Thanks for trying it out, let me know if you have any questions, comments, or scathing rebuttals.

  3. Great tool, but found an issue is you try to have a OLE connection in Catalog. If you have the Domain Sorter Toolbar active (on) in Cat, and click on the OLE connection, Cat bombs. If you turn off the tool and click on the OLE connection, Cat is fine.

    Please test the tool with OLE connections and try to correct issue.

  4. Thanks Mike & Kirk. I did correct the OLE issue you found, Kirk. Sorry about that, I have updated the code and updated the links in both this post and at ESRI’s Resource Center.

    • Thanks for fixing the issue with OLE connections in ArcCat. The new dowload does not look like it has been compile as an Esri Add-In tool. Please check the new zip file that should contain an “toolName.esriAddIn” file.

      Thanks again for updating the original VB6 code and making this an Add-In. It is a great tool to have.

  5. Has anyone had any problems loading this add-in? I downloaded this because we have a need to sort domain values in the geodatabases we use at work. I mapped to the folder I placed the .addin file and used the ‘Add from file’ button to install the add-in. The installation seemed to work, but the Domain Sorter toolbar did not appear in the Customize toolbar tab, nor the Add-in manager. We are running an ArcView level ArcGIS 10 license at work. Does this require a higher level license?

    • James, two quick thing come to mind. First, are you trying to use the Add_in from ArcCatalog? It will not show up as an option in any other application (including ArcMap). Second, you have to select “Load all Add-Ins without restrictions (Least Secure)” on the Options tab of Add-In Manager.

      Hope that helps.

      Matt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s