I've got a model for a task I have to perform frequently, I recently added some additional functionality with a few scripts to automate adding the map changes to my layout, setting the title, and running table to excel as well as exporting the layout to pdf. Everything works great for the most part, but when it hits the export to .pdf stage, the map doesn't contain any of the features the model has added to it. The export is the last operation, and as soon as the model finishes, the map updates and looks like it should. Is there a way to force the map to update in the middle of a model? From what I'm reading Esri did away with the arcpy.RefreshActiveView() method, hoping there's another way. At first I tried adding a time.sleep() to the export script, but that just delays the process, update still doesn't occur until after the model has ran. Tried adding multithreading which surprisingly didn't change the behavior either. I've also tried stacking additional geoprocessing tasks between the rest of the model and the export, but nothing I've done has helped. Anyone know of a work around/fix? Thanks.
Solved! Go to Solution.
Wasn't able to find anything that worked so I just converted the whole thing to a Python script.
Might be worth trying to run a submodel https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/modelbuilder/add-a-submodel-to-...
Wasn't able to find anything that worked so I just converted the whole thing to a Python script.