Select to view content in your preferred language

Applying a spatial reference to a map causes unpredictable freeze ups.

107
5
yesterday
RandyMcGregor_BMcD
Frequent Contributor

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.

RandyMcGregor_BMcD_0-1760991701485.png

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. 

RandyMcGregor_BMcD_1-1760992143602.png

 

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

BUG-000129693 for ArcGIS Pro

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


... sort of retired...
0 Kudos
RandyMcGregor_BMcD
Frequent Contributor

Thank you very much! I'll change the input (It's a python script tool) to ask for the WKID. 

0 Kudos
RandyMcGregor_BMcD
Frequent Contributor

Darn. That was not it. I think the setting of the spatial refernece is fine. It's just applying it to the map that fails after doing it a certain number of times. I set the spatial reference using the WKID and same result:

RandyMcGregor_BMcD_0-1761050992817.png

 

0 Kudos
RandyMcGregor_BMcD
Frequent Contributor

Trying again and it won't even update the spatial reference on the first map. 

RandyMcGregor_BMcD_0-1761051475682.png

 

0 Kudos
RandyMcGregor_BMcD
Frequent Contributor

I think I see the problem. I was going to delete these messages, but maybe there is useful information here? I was using Web Mercator (auxilliary sphere) project for testing. Don't ask why. That would NEVER be the spatial reference I would want to use for this script. I tried UTM zone 15, and State Plane Texas Central. Both worked fine. So, it looks like there is an issue with applying Web Mercator (auxilliary sphere) spatial reference to maps programatically?

0 Kudos