Create feature class template with Domains

400
2
06-02-2020 02:04 AM
Status: Open
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

2 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