Select to view content in your preferred language

How to get point position in layout?

932
4
11-02-2020 12:48 PM
anyry
by
Occasional Contributor

Hello, 

I have layer of points and I need know their position in layout (in milimetres) from map frame. How can i do that please?

Thanks

Tags (1)
0 Kudos
4 Replies
DavidPike
MVP Frequent Contributor

The DataFrame Class will have the origin of the data frame in page units, but the location of points in the layer aren't referenced in any classes that I know of (my lack of knowledge on this is not an indication of very much).

You may have better luck by converting your points to graphics then using the arcpy.mapping GraphicElement.elementPositionX, GraphicElement.elementPositionX  class (or Pro equivalent).

I would also do physical trials to see if print margins etc. are included.

0 Kudos
anyry
by
Occasional Contributor

Thanks but I think that in Pro is not possible convert features to graphics.

0 Kudos
DavidPike
MVP Frequent Contributor

I had a think about this.

You coukd get the origin coordinates of the extent of your dataframe, then take the shape x,y xoordinates of each point and minus the dataframe origin coordinate values.

the dataframe also has a scale attribute value which you can then divide by to get the paper distance(x,y) of each point from the dataframe.

then add these values to the x,y position of the dataframe.

simples!

anyry
by
Occasional Contributor

That's great idea! thank you so much, David.

0 Kudos