<?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>topic Re: Moving Layout elements in ArcMap using Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370842#M29310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I figured it out.&amp;nbsp; I should have been using a TEXT_ELEMENT instead of a GRAPHIC_ELEMENT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Silly mistake, sorry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jan 2014 20:25:24 GMT</pubDate>
    <dc:creator>AndrewBrachman1</dc:creator>
    <dc:date>2014-01-20T20:25:24Z</dc:date>
    <item>
      <title>Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370836#M29304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having some severe difficulties trying to move graphics and text elements in layout using Python. I figured it would be pretty simple, just access the layout elements and change the anchor point. I copied this code from the help and changed it to reflect the filepath and element name in my map document:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "Title Block":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.elementPositionX = 4.75&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.elementPositionY = 10.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.save()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run it through a Python script tool or the Python window, I get this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IOError: MapDocObject: Unable to save.&amp;nbsp; Check to make sure you have write access to the specified file and that there is enough space on the storage device to hold your document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have read/write privileges and there is certainly enough disk space, so I don't know what the problem is. I tried commenting out the last two lines of code and it ran without errors, but the element I was trying to use didn't move. I suspect there is something very simple and silly happening here that I am missing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 21:58:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370836#M29304</guid>
      <dc:creator>MattBull</dc:creator>
      <dc:date>2013-06-10T21:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370837#M29305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Normally get that error when the mxd is being viewed in ArcMap or ArcCatalog at the time the script runs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can't just close file either, need to exit ArcMap/Catalog before you run the script.&amp;nbsp; Also, look in task manager and make sure there isn't a "runaway" arcmap that is "locking" the file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 22:58:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370837#M29305</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-06-10T22:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370838#M29306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you both, that is valuable information. Using the CURRENT keyword did exactly what I wanted the script to do, but it's also good to know that I need to be running the script outside of ArcGIS if I'm going to use the file path.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 13:30:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370838#M29306</guid>
      <dc:creator>MattBull</dc:creator>
      <dc:date>2013-06-11T13:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370839#M29307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having some trouble with a similar issue in moving an element.&amp;nbsp; For some reason the code is passing right by the FOR loop.&amp;nbsp; I am guessing it is really simple.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Open RigMap.mxd&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"D:\Temp\TestRigMapPython\UnitedStates_Basemap3.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Export RigMap to JPEG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.ExportToJPEG(mxd, "D:\Temp\TestRigMapPython\TestRigMap.jpg", resolution = 300)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Move text off of map area&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for graphic in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if graphic.name == "Statistics":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.elementPositionX = 4.4688&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.elementPositionY = -0.505&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Export 30 Day PermitMap to JPEG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.ExportToJPEG(mxd, "D:\Temp\TestRigMapPython\Test30DayPermitMap.jpg", resolution = 300)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 22:11:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370839#M29307</guid>
      <dc:creator>AndrewBrachman1</dc:creator>
      <dc:date>2014-01-16T22:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370840#M29308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;perhaps its not finding a graphic element called "Statistics".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Double check that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;N&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 12:28:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370840#M29308</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2014-01-17T12:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370841#M29309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did check that and that doesn't seem to be the problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One thing I tried was to put a print statement right inside of the for loop.&amp;nbsp; It never reaches the for loop so I am not sure what is going on.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jan 2014 21:02:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370841#M29309</guid>
      <dc:creator>AndrewBrachman1</dc:creator>
      <dc:date>2014-01-18T21:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Layout elements in ArcMap using Python</title>
      <link>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370842#M29310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I figured it out.&amp;nbsp; I should have been using a TEXT_ELEMENT instead of a GRAPHIC_ELEMENT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Silly mistake, sorry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2014 20:25:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/moving-layout-elements-in-arcmap-using-python/m-p/370842#M29310</guid>
      <dc:creator>AndrewBrachman1</dc:creator>
      <dc:date>2014-01-20T20:25:24Z</dc:date>
    </item>
  </channel>
</rss>

