We have a process that allows users to select multiple features then batch export a layout of each feature. For each feature, make it the only one visible in the map, zoom to it, populate the layout with certain attributes, then export the layout to the selected file format. To keep the layouts uniform, we have a .pagx template that we delete from the project if it already exists and re-import at the beginning of each loop.
In ArcMap, the process works fine, but in Pro the map frame in the first layout we created wouldn’t update. Even though we awaited the QueuedTasks that add the template to the project and get the layout, the map frame wouldn’t update. The workaround we’ve come up with is to import the layout, populate it with attributes, then work with the map frame. It seems like LayoutProjectItem.GetLayout() is either returning before the map frame is loaded or waiting until other properties are set to load the contents of the layout. Is there a better way to handle this process?
1. You can set the caching behavior for a feature layer from the Layer Properties dialog box.
2. Try setting map extent also