Layout returned before fully loaded

180
1
11-23-2020 07:48 AM
StephenRhea_GISInc
New Contributor II

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?

0 Kudos
1 Reply
HarishPalaniappan
New Contributor III

Hi @StephenRhea_GISInc 

1. You can set the caching behavior for a feature layer from the Layer Properties dialog box.
https://pro.arcgis.com/en/pro-app/help/mapping/layer-properties/how-caching-works.htm

2. Try setting map extent also
https://pro.arcgis.com/en/pro-app/help/mapping/properties/set-a-custom-full-extent.htm

 

Thank you!

0 Kudos