Select to view content in your preferred language

Way to update the map in the middle of a model?

443
3
Jump to solution
04-13-2023 11:50 AM
Austin_Bachurski
New Contributor II

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.

0 Kudos
1 Solution

Accepted Solutions
Austin_Bachurski
New Contributor II

Wasn't able to find anything that worked so I just converted the whole thing to a Python script.

View solution in original post

0 Kudos
3 Replies
DavidPike
MVP Frequent Contributor
0 Kudos
Austin_Bachurski
New Contributor II
Tried that too... Thank you though.
0 Kudos
Austin_Bachurski
New Contributor II

Wasn't able to find anything that worked so I just converted the whole thing to a Python script.

0 Kudos