Select to view content in your preferred language

Using ArcPy to copy sub types from one layer to another

399
3
03-25-2024 06:47 PM
JMagson
New Contributor II

Is there a way to preserve subtypes in my python script tool?

I can preserve the domains in environment settings when running the tool, but sub types are not copied to the output.


Because my domains rely on subtypes, they do not work correctly in the output unless I manually set up the sub types.

It seems this has been an ongoing request for a few years. Does anyone know any work arounds?

Tags (2)
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

In the Rules section of

Geoprocessing considerations for subtypes—ArcGIS Pro | Documentation

lists the tools that support subtypes, all of which are accessed through arcpy or are you looking to not call a tool?


... sort of retired...
0 Kudos
JMagson
New Contributor II

my script doesn't naturally use any of those tools, so sub types are not preserved.

Thanks for the link though it gave me an idea: A work around could be to use export feature on my input dataset to create a copy, then append the output from my script tool into it.

0 Kudos
DanPatterson
MVP Esteemed Contributor

Yes... they are on the list of supported functions


... sort of retired...
0 Kudos