I have a script tool that applies updates to every 'main map' in the layouts in an aprx. When I include the funcionality to set the spatial reference, it acts very strangely. It will set the spatial reference for some maps, and freeze up on one, and it's over. It never moves on. There is no rhyme or reason that I can see. It sometimes gets to the fourth layout, sometimes it only does the first layout. Once it did all layouts, but froze on the last one, and I have to shut down the map with the task manager. It's frozen solid as a rock.
The two highlighted lines are the culprit. If I comment them out, the script goes through every map no problem. It's just the application of the spatial reference that does it. I can't ask anyone to troubleshoot. I'm just wondering if this is an issue anyone is familiar with. Is setting spatial reference with python normally this persnickety? I have to take this functionality out of the tool for now.
Thank you for any information you may be able to provide.
This time, the code ran through every layout, found the main map, applied the spatial reference to all but the last one, and got stuck. Sometimes it gets stuck on a different layout. After successfully applying the spatial reference, the message 'Adding Project Alsignment...' appears.
only one but an oldie when using wkt names vs well-known ID (WKID)
at this stage worth a look or Tech Support in case they have non-public facing issues that are similar
Thank you very much! I'll change the input (It's a python script tool) to ask for the WKID.