Select to view content in your preferred language

Export feature class from ArcMap (or ArcCatalog) to ArcGIS Pro

147
3
Friday
DN_GIS_Analyst
Emerging Contributor

Hi,

When working directly with ArcMap or ArcCatalog, I'm able to export a feature class from its SDE to a geodatabase in ArcGIS Pro, it works fine.

However, I encountered a problem in exporting the feature class via a python script. I frequently get the Error 000210.

import arcpy

arcpy.env.workspace = r"C:\Users\My_SDE.sde\GISUtility.ARC.Electric"
output_gdb = r"C:\Users\My_GDB.gdb"

# Feature class names you care about
target_fcs = ["GISUtility.ARC.ePriOHConductor", "GISUtility.ARC.ePriUGConductor"]

for fc_name in arcpy.ListFeatureClasses():
    if fc_name in target_fcs:
        out_name = "Primary_OH_Exported" if "OH" in fc_name else "Primary_UG_Exported"
        out_path = f"{output_gdb}\\{out_name}"

        if arcpy.Exists(out_path):
            arcpy.Delete_management(out_path)

        print(f"?? Exporting {fc_name} to {out_path}")
        arcpy.FeatureClassToFeatureClass_conversion(fc_name, output_gdb, out_name)

For whatever reasons, I cannot get it to work properly. I would like to automate this step rather than manually opening ArcMap or ArcCatalog to export the data over to the Pro.

I set the env path to the feature dataset in the SDE. Previously I tested this by adding a arcpy.ListFeatureClasses(), and it was able to list the feature classes, so I knew it could read the feature classes. However, I'm unable to do anything like exporting the feature class from ArcMap or ArcCatalog to ArcGIS Pro.

I am using ArcMap 10.8 and ArcGIS Pro 3.2.2

0 Kudos
3 Replies
AlfredBaldenweck
MVP Regular Contributor

I feel like I'm missing something. Why do you need to "export to ArcGIS Pro"? Pro should be able to read the files itself, shouldn't it?

DN_GIS_Analyst
Emerging Contributor

Because of the screenshot below:

Add_Data_Problem.png

 

DN_GIS_Analyst
Emerging Contributor

I don't encounter the problem like shown in the screenshot if I do this directly from ArcMap or ArcCatalog.

0 Kudos