CopyFieldsAndDomains

Title  Copy Fields and Domains

Description

Copies fields and domains from FeatureClass/Table to FeatureClass/Table

Usage

          


License

Basic

Syntax

CopyFieldsAndDomains (in_classes, target_class, {selected_fields}, {lower_case}, {assign_to_subtype}, {consolidate_domains})

Parameter Explanation Data Type
in_classes Dialog Reference

The input classes to copy fields from.

GPTableView
target_class Dialog Reference

The target class to create fields in.

GPTableView
selected_fields (Optional) Dialog Reference

The fields from the source not present in the target that will be copied.

GPFieldMapping
lower_case (Optional) Dialog Reference

Copy all the fields as lower case.

GPBoolean
assign_to_subtype (Optional) Dialog Reference

Assign the Domain and Default values to target subtypes. If the source has subtypes codes that match the target, those domains assigned those subtypes will be applied. If a domain is at the field and has no matching assignments, it will be set on all target subtypes.

GPBoolean
consolidate_domains (Optional) Dialog Reference

When there are multiple sources and those sources have different domains assigned to the same field, merge them into a single domain. If that merged domain is repeated across fields, it is also combined.

GPBoolean

Code Samples

CopyFieldsAndDomains example 1 (Python window)

Copies fields and domains from the wSystemValve layer to the WaterDevice layer.

import arcpy

arcpy.udms.CopyFieldsAndDomains("wSystemValve", "WaterDevice", ["WO_ID", "IS_ACTIVE"], True)

CopyFieldsAndDomains example 2 (stand-alone script)

Copies fields and domains from the wSystemValve layer to the WaterDevice layer.

import arcpy

arcpy.udms.CopyFieldsAndDomains(
    in_class="wSystemValve",
    target_class="WaterDevice",
    selected_fields=["WO_ID", "IS_ACTIVE"],
    lower_case=True,
)