From documentation (GraphicElement—Help | ArcGIS for Desktop ) elements can be deleted as below but after one element deletion layout refreshes with delete function and if you have good amount of elements at layout this operation requires good time to be finished. How can this elements can be deleted simultaneously ? One delete and refresh operation would be better for time perpective, any idea'd be helpful.
for elm in arcpy.mapping.ListLayoutElements(mxd, wildcard="_clone"😞
elm.delete() del mxd
Thanks in advance.
The only reason the layout view would need to refresh after each deletion is if you were running this code with the python interpreter in an actual map document. Why not run a standalone script that opens the map document in memory and deletes the cloned graphic elements. The only time the layout view changes when processing outside of a map document is when you tell the layout to refresh the active view or save the map.
That'll be at the end of project. For now, watching at mxd is better, faster. After executing stand-alone script, mxd opening was the avoided time cost and now execution time on actual mxd starts to exceed that time.