Select to view content in your preferred language

create a list for subtype

1486
5
09-26-2019 06:37 AM
PSGeo
by
Regular Contributor

Dear all,

Still using ArcGIS 10.5. File GDB.

i need to create a huge list of subtype. and i have it in a excel file.

It is easy to make it a domain. but not easy to make it a subtype.

I am trying to make a list out of the excel, and than import it using the "Add subtype" tool in toolbox to the subtype.

Did anyone tried this?

does it work?

thanks 

P

Tags (2)
0 Kudos
5 Replies
TylerSchwartz2
Frequent Contributor

The Add Subtype tool requires you have a table (feature class) that already has a subtype field designated.  This tool will add more code name pairs to the already setup subtype.  The "input table" listed in the tool is the already existing feature class that has the subtype already setup, unfortunately.  This tool is different than the "Table to Domain" tool.

I do not know of a way to import a large list of subtypes in a table automatically, but as you mentioned this can easily be done with a domain.

You may have to setup each subtype individually.  I have found this is much easier to do in Pro using the "Data" ribbon, "Subtypes" tab, and then clicking on the Create/Manage.  This will allow you to add multiple subtypes (albeit manually) without having to run the "Add Subtype" tool multiple times.

0 Kudos
Robert_LeClair
Esri Notable Contributor

Pedro - I found an old GeoNet thread that redirects to Dropbox to download a toolbox/python script that's been updated from 9.x to 10.4 ArcMap.  Might be worth a try - let me know how it goes.

0 Kudos
PSGeo
by
Regular Contributor

good morning... been on holidays.

meanwhile i solved it +/-.

Using Python:

- First i created a List (i will need to create some other list for other subtypes in different FC)

- Second I copied the list to a second script that does the subtype using the following arcpy.AddSubtype_management

Now the challenge is to add a default domain to a field for some of these!

cheers

0 Kudos
AbdulabnanMohammed
Occasional Contributor

Hi @PSGeo 

Could you kindly share your experience sub type and domain..

I have same requirement for huge list in excel
I shall be thankful to you
Thank you

0 Kudos
RobertKrisher
Esri Regular Contributor

You can read sheets within an Excel workbook using a Data Access SearchCursor. Subtypes can be added using the Add Subtype GP tool. Domains can be created or altered using the various GP tools (Create Domain, Assign Domain to Field, etc). You can review existing subtypes and domains in a geodatabase using the ListSubtypes and ListDomains methods.

Each of these pages includes sample code to help you understand how to use the APIs.

0 Kudos