In an MXD file, I have a page layout and a map with a north arrow, and I need to move it in the page layout programmatically using ArcObjects Java SDK.
I managed to get the north arrow map surround object:
for(int i = 0; i < dataFrame.getMapSurroundCount(); i++) {
IMapSurround mapSurround = dataFrame.getMapSurround(i);
if(mapSurround instanceof INorthArrow) {
log.info("North");
// ...
}
if(mapSurround instanceof IScaleBar) {
log.info("scale bar");
}
}
Now, I need to get my north arrow as an IElement, in order to apply an Envelope as a geometry, that will cause the north arrow to be moved within the page layout.
INorthArrow cannot be cast to IElement (ever tried).
Any idea to get an IElement?