Select to view content in your preferred language

Create feature class template with Domains

1420
4
06-02-2020 02:04 AM
Status: Implemented
Labels (1)
StuartMoore
Occasional Contributor III

So i have found that using the create feature class from a template doesn't create the domains associated to the template feature class, i think if your creating a new FC from a template then you are looking for it to be identical include the domains (well that's what i'm looking for)

i think a workaround would be to use python to iterate over the domains in the template and create / assign them to the new FC but it would be so much nicer if using the template did it be default

thanks

Stu

4 Comments
KoryKramer

Thank you for submitting the idea, Stu!  It's valid and open for voting.

Just a couple of notes.  Since you're talking about the Template, I'm assuming your using the geoprocessing tool, correct?

I'm assuming that you're looking for the same behavior if using the Create Feature Class wizard > Import?

It looks like those definitely don't include domain definitions on fields.

I wanted to point out, though, to help get you what you're looking for today, you can export the feature class (schema only if you want) to XML:

and then import that.  If you're importing into the same geodatabase, note that you'll get a warning that the original feature class will be overwritten.  You can pop the xml open in a text editor and update the name before importing.

That makes for an easy import of the schema that will maintain the domains on your fields.

Hope this helps!

StuartMoore

Hi Kory, thanks for that, i did read a few things about the ability to export the schema but didn't explore it further.

i found the issue out when creating a python toolbox to export a layer from our Enterprise geodatabases into a FGDB but i wanted to maintain the objectID, to do this the script creates a new FGDB and in it creates a new feature class using the Enterprise feature class as a template, then it adds in a new field for the original object it, and then using append it transfers the data over. but that's when i realised the issue with the domains

thanks

Stu

SSWoodward
Status changed to: Implemented

It looks like this idea is a duplicate of the Idea linked below.  Luckily, that idea was implemented in ArcGIS Pro 3.1!

Using a feature class template in the 'Create Feature Class' Geoprocessing tool, and importing a class in the Feature Class Wizard, both now bring over the templates classes domains, as long as they are present in the destination workspace. 

Duplicate Idea - Set Domains in Create Feature Class 

RickMomsen

@SSWoodward I just upgraded to 3.1.0 for this functionality and it is not working. 

arcpy.CreateFeatureclass_management(gdb, "sometest3", template=fc_template)

fc_template has a handful of domains and none transferred over to sometest3

 

is this a 3.1.1 functionality?