I want to set the position of my legend based on values of a "Data Driven Pages" attribute. Yet I don't have any code. This is just collection of what I think I need.
I had to read the value from the Data Driven Page attribute field.
posY = tempMap.dataDrivenPages.pageRow.posY
posX = tempMap.dataDrivenPages.pageRow.posX
And change the values of the legend objekt.
mylegend.elementPositionY = posY
mylegend.elementPositionX = posX
The script should trigger by changing the Data Driven Page. This should also work then I print all pages.
def pageIndexExtentChanged(seld, new_id)
Problem: I had to change the anchor position to set the correct X/Y values (height and width of the legend is dynamic and may change). How can I achieve this (see picture)?