Hello,
I have some issues with setting the rotation of a a group in a Layout
So here from my python code, I am trying to rotate the whole Angle_0 group, its works when I do it from Pro, but when setting it from python, it does not work !
Here's the python code part that does it
Do you know why I have this weird result ?
Thanks
I think the issue is that you're using "rotation" instead of "elementRotation". For some reason, this does not throw an error, although my guess is it is assumed you're adding a new property to the layoutElement that just nothing knows how to read.
import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
lay = aprx.listLayouts()[0]
grp = lay.listElements(wildcard = "Group Element")[0]
for sub in grp.elements:
if sub.name == "nestedGrp":
sub.setAnchor("LEFT_MID_POINT")
sub.elementRotation = 90
else:
sub.setAnchor("CENTER_POINT")
sub.elementRotation = 0