<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>idea Get and set layout element anchor points in ArcPy in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idi-p/944308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I&amp;nbsp;need to be able to get and set the anchor points of layout elements in ArcPy. Currently, it is impossible for arcpy to know whether the layout elements of any given MapDocument are on or off  the layout. You can access the XY positions of the elements, but these are in relation to their anchor point which could be different for each element. This would be very helpful for map automation scripts, as I&amp;nbsp;currently have to make separate versions of my scripts for MXDs that have slightly different layout elements or page sizes.&lt;BR /&gt;&lt;BR /&gt;

&lt;!-- content transformation source ID: 08730000000bmk8 --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2011 19:13:26 GMT</pubDate>
    <dc:creator>TannerSemerad1</dc:creator>
    <dc:date>2011-05-17T19:13:26Z</dc:date>
    <item>
      <title>Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idi-p/944308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I&amp;nbsp;need to be able to get and set the anchor points of layout elements in ArcPy. Currently, it is impossible for arcpy to know whether the layout elements of any given MapDocument are on or off  the layout. You can access the XY positions of the elements, but these are in relation to their anchor point which could be different for each element. This would be very helpful for map automation scripts, as I&amp;nbsp;currently have to make separate versions of my scripts for MXDs that have slightly different layout elements or page sizes.&lt;BR /&gt;&lt;BR /&gt;

&lt;!-- content transformation source ID: 08730000000bmk8 --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 19:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idi-p/944308</guid>
      <dc:creator>TannerSemerad1</dc:creator>
      <dc:date>2011-05-17T19:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/944309#M6079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agreed. If I could even read which anchor point the layout item was using, even if I couldn't change it, that would be tremendously helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 22:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/944309#M6079</guid>
      <dc:creator>ShannonDeArmond</dc:creator>
      <dc:date>2016-10-25T22:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/944310#M6080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Any update on this? did you find a solution? i'm facing the same issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2018 10:16:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/944310#M6080</guid>
      <dc:creator>HeshamOthman1</dc:creator>
      <dc:date>2018-12-17T10:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/944311#M6081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would be very helpful, right now I have to validate the anchor point positions by hand which kind of defeats the purpose of automating with python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2019 19:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/944311#M6081</guid>
      <dc:creator>GrantHaynes</dc:creator>
      <dc:date>2019-06-06T19:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1038890#M15499</link>
      <description>&lt;P&gt;Completely agree with other commenters here, and &lt;A href="https://gis.stackexchange.com/questions/181617/change-anchor-point-using-arcpy" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. This would make automation in Pro/Map tremendously easier. ESRI, can you please add an "elementAnchor" property to the different layout elements.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArcGIS_ElementAnchorPropertyNeeded.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8985i48B9BD122F2FF06E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArcGIS_ElementAnchorPropertyNeeded.jpg" alt="ArcGIS_ElementAnchorPropertyNeeded.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 22:16:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1038890#M15499</guid>
      <dc:creator>KennethEggering1</dc:creator>
      <dc:date>2021-03-19T22:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1168012#M19428</link>
      <description>&lt;P&gt;+1 for this idea&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 17:38:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1168012#M19428</guid>
      <dc:creator>RossVolkwein1</dc:creator>
      <dc:date>2022-04-26T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182330#M19850</link>
      <description>&lt;P&gt;Starting with Pro 2.5, this can be accomplished using Python CIM Access&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a simple snippet:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;p =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://arcpy.mp/" target="_blank" rel="noopener"&gt;arcpy.mp&lt;/A&gt;.ArcGISProject('current')&lt;BR /&gt;lyt = p.listLayouts()[0]&lt;BR /&gt;lyt_cim = lyt.getDefinition('V3')&lt;BR /&gt;for e in lyt_cim.elements:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://e.name/" target="_blank" rel="noopener"&gt;e.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;== 'Rectangle':&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(elm.anchor)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;###BottomLeftCorner&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 13 Jun 2022 15:10:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182330#M19850</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-06-13T15:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy - Status changed to: Already Offered</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182333#M19851</link>
      <description>&lt;P&gt;Starting with Pro 2.5, this can be accomplished using Python CIM Access&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a simple snippet:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;p =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://arcpy.mp/" target="_blank" rel="noopener nofollow noreferrer"&gt;arcpy.mp&lt;/A&gt;.ArcGISProject('current')&lt;BR /&gt;lyt = p.listLayouts()[0]&lt;BR /&gt;lyt_cim = lyt.getDefinition('V2')&amp;nbsp; &amp;nbsp;#for 2.x and '3.0' for 3x&lt;BR /&gt;for e in lyt_cim.elements:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://e.name/" target="_blank" rel="noopener nofollow noreferrer"&gt;e.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;== 'Rectangle':&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(elm.anchor)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;###BottomLeftCorner&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 21:06:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182333#M19851</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-06-13T21:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182342#M19852</link>
      <description>&lt;P&gt;Cool! Thanks for the update.&lt;/P&gt;&lt;P&gt;I received an error saying I needed to use cim_version 'V2' but that seems to work okay.&lt;/P&gt;&lt;P&gt;Are you supposed to be able to set the anchor as well? It looks like it works, but the actual element properties in the layout don't seem to update.&lt;/P&gt;&lt;P&gt;Also, type, should be "&lt;SPAN&gt;&amp;nbsp;print(e.anchor)"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 15:28:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182342#M19852</guid>
      <dc:creator>RossVolkwein1</dc:creator>
      <dc:date>2022-06-13T15:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182476#M19854</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/497800"&gt;@RossVolkwein1&lt;/a&gt;&amp;nbsp;Sorry about that.&amp;nbsp; I'm using Pro 3.0.&amp;nbsp; I'll update the script above.&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 21:06:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1182476#M19854</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-06-13T21:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get and set layout element anchor points in ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1240038#M22489</link>
      <description>&lt;P&gt;For anyone in the future wondering how to set the anchor point, heres a code snipped from the resources provided by esri (&lt;A href="https://www.arcgis.com/home/item.html?id=8772f61319584882bb697ba003030636" target="_blank" rel="noopener"&gt;ArcGIS Pro 2.5 CIM Samples V1 - Overview&lt;/A&gt;)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts('GreatLakes')[0]

lyt_cim = lyt.getDefinition("V2")     #Get the layout's CIM definition

#Iterate though all layout elements to find the PointText element
for elm in lyt_cim.elements:
  if elm.name == "Point Text":
    txt = elm
    elm.anchor = 'CenterPoint'        #Change anchor position

lyt.setDefinition(lyt_cim)            #Set the layout's CIM definition&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last line (12) is required for the anchor to change&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 06:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/get-and-set-layout-element-anchor-points-in-arcpy/idc-p/1240038#M22489</guid>
      <dc:creator>AK20221130</dc:creator>
      <dc:date>2022-12-12T06:14:46Z</dc:date>
    </item>
  </channel>
</rss>

