pro_live_execute
Execute Python directly in the active ArcGIS Pro session to apply symbology, add layers, or save projects with immediate visual feedback.
Instructions
Execute Python INSIDE the currently open ArcGIS Pro application.
Unlike arcpy_execute (headless background session), this runs in the live
Pro session the user is looking at: arcpy.mp.ArcGISProject("CURRENT")
works, added layers appear immediately, the open project can be saved.
Requires the user to have cowork mode running — if no listener responds,
the error includes the exact one-liner they must paste into Pro's Python
window. Variables persist between calls (separate namespace from
arcpy_execute). Caution: prefer data/layer/symbology operations; avoid
rapid or repeated view/camera manipulation, which can destabilize Pro.
Pass action as a short human label ("Applying symbology") - it shows in
the user's add-in activity log. House rules: don't create new .aprx files,
maps, layouts or layers unless the user asked; after changing a map or
layout, call its .openView() so the change appears instantly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| action | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |