Select to view content in your preferred language

Map Series: Apply Map Angle rotation to text_element akin to North Arrow.

39
0
7 hours ago
SB_Brent
New Contributor

ArcGIS Pro Version 3.2.2

Hello! 

Within a map series, I have an attribute of the Index Layer "MapAngle" that informs the rotation of each page. This intuitively adjusts the North Arrow across each page of the layout. Alongside my North Arrow rotation, I would like to apply the same MapAngle rotation to my reference scale (Ex. 1"=200') for each page in the map series.  

Desired Outcome: A Scale reference that automatically rotates and updates with dynamic text for each page in a map series layout. 

SB_Brent_0-1727709613045.png 

SB_Brent_2-1727713425648.png

 


Methods Explored:
1. Adjusting the Text feature element properties allows for an individual Rotational call, but it does not reference "MapAngle" and adjust appropriately across the Map Series.

 
2.  Using Python, I attempted to rotate the text element for each page in the map series, with an excerpt of the script ran below. I was able to execute my script, but without success. I suspect the script iterates through the map series and rotates the box, but does not store any of these changes to rotate with each page. Functionally just rotating the box, and restoring it to the final call in the series (0 Rotation). 


# Loop through each page in the map series
for page_num in range(1, map_series.pageCount + 1):
# Set the current page
map_series.currentPageID = page_num

# Get the current page's MapAngle
where_clause = f"OBJECTID = {page_num}" 
with arcpy.da.SearchCursor(page_index_layer, ["MapAngle"], where_clause) as cursor:
for row in cursor:
map_angle = row[0]

# Find the text box object
text_box = layout.listElements("TEXT_ELEMENT", "RotationBox")
if text_box:
text_box = text_box[0]
# Apply the rotation
text_box.rotation = map_angle
print(f"Set rotation for page {page_num}: {map_angle} degrees")
else:
print("Text box 'RotationBox' not found.")

3. I was encouraged to create a custom North Arrow Style - but was unable to include dynamic text as an element within a North Arrow. This solution seems most desired, where the scale reference would be embedded within the North Arrow. I had limited luck with this method as well. 😞

Any Insights or wisdom provided is greatly appreciated, and thank you in advance. 

0 Kudos
0 Replies