I use arcpy function XYTableToPoint_management() to create a new layer vessel_coordinate into the current active map, as shown below.

enter image description here

But when I list the layers in this map (map.listLayers()), I hope to see this new layer appeared. But it didn't.

I try to use aprx.save() and aprx.saveACopy() to update the project file .aprx, but it still didn't work..

Could anyone suggest which method I can use to refresh the project file and include the newly created layer in the layer list...

  • 1
    Ok, I find arcpy.mp.ArcGISProject("CURRENT") can help... – LUSAQX Jun 11 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.