Hello,
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.
<SPAN class="pln">posY </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> tempMap</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">dataDrivenPages</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">pageRow</SPAN><SPAN class="pun">.</SPAN>posY
<SPAN class="pln">posX </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> tempMap</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">dataDrivenPages</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">pageRow</SPAN><SPAN class="pun">.</SPAN>posX
And change the values of the legend objekt.
<SPAN class="n">mylegend.elementPositionY = posY</SPAN>
<SPAN class="n">mylegend.elementPositionX = posX</SPAN>
The script should trigger by changing the Data Driven Page. This should also work then I print all pages.
<SPAN class="n">def pageIndexExtentChanged(seld, new_id)<BR /></SPAN>
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)?