When creating feature classes dynamically using python code, it is very inefficient to have to call CreateFeatureClass and then call AddField multiple times to create the additional attribution. The CreateFeatureClass tool should allow the passing in of a list of fields (and their data types, aliases, default value, etc.) in addition to supporting a template feature class. The template option works great if you actually have a template to build from, but when building new feature classes on-the-fly that don't have a template, being able to pass in the field listing rather than have to call AddField multiple times would be a much better option.
Additionally, the template can/should be a table or table view, not a feature layer. Currently even if I have a table with all the fields exactly like I want them, there isn't any way to pass that table as a template in to the createfeatureclass function.
Thank you for your submission, and apologies for the very late response. Your post was only recently redirected to the correct ideas exchange for Python/ArcPy ideas.
It turns out we have implemented AddFields (multiple) some time ago, and it is intended to fill the gap discussed here. While it is not exactly as requested, using CreateFeatureClass and AddFields together provides the ability to generate new FeatureClasses on-the-fly, or add additional fields to an existing FeatureClass. For this reason, we are closing this idea now as implemented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.