arcpy script to add a map layer from a geodatabase feature class?

المشرف العام

Administrator
طاقم الإدارة
Emi's post helped me with this:how-do-results-from-a-python-script-get-added-to-an-arcgis-map

However there was a typo. I'm posting the corrected code here (since I just signed up and don't have the rep to comment there).

tempLayer = "layer"# Make a layer from the feature classarcpy.MakeFeatureLayer_management("C:/data/mexico.gdb/cities",tempLayer)addLayer = arcpy.mapping.Layer(tempLayer)arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE")arcpy.RefreshTOC()

أكثر...
 
أعلى