<?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: arcpy.mapping export not behaving as expected in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690492#M53533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When altering between inside / outside of ArcMAP, can you confirm you just change the line of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(mxdLocation)

to 
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("CURRENT")



and everything else remains the same?&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:04:02 GMT</pubDate>
    <dc:creator>LukeWebb</dc:creator>
    <dc:date>2021-12-12T05:04:02Z</dc:date>
    <item>
      <title>arcpy.mapping export not behaving as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690491#M53532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was running arcpy.mapping tools and noted different behaviour running inside ArcMap python window and outside of it.&amp;nbsp;The following is the partial code extract.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(mxdLocation)
df = arcpy.mapping.ListDataFrames(mxd)[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;] &lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;lyr = arcpy.mapping.ListLayers(mxd,&lt;SPAN style="color: #660099;"&gt;data_frame&lt;/SPAN&gt;=df)[0]&lt;/PRE&gt;currentLyrExtent=lyr.getExtent()&amp;nbsp;&amp;nbsp;&lt;BR /&gt;df.extent = currentLyrExtent&lt;BR /&gt;currentLyrName=lyr.name&lt;BR /&gt;arcpy.RefreshActiveView()&lt;BR /&gt;arcpy.mapping.&lt;STRONG&gt;ExportToPNG&lt;/STRONG&gt;(mxd,currentLyrName+".png",&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"PAGE_LAYOUT"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the exported image&amp;nbsp;after running in ArcMap Python window. Looks ok.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="j-img-floatstart image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/273979_Lakes.png" style="width: 620px; height: 413px; float: left;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the exported image after running outside of ArcMap. The image only fills up 1/4 of the whole image frame.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/273995_Lakes.jpg" style="width: 620px; height: 413px;" /&gt;&lt;/P&gt;&lt;P&gt;What could be wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:04:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690491#M53532</guid>
      <dc:creator>Kah_SiongTan</dc:creator>
      <dc:date>2021-12-12T05:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mapping export not behaving as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690492#M53533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When altering between inside / outside of ArcMAP, can you confirm you just change the line of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(mxdLocation)

to 
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("CURRENT")



and everything else remains the same?&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:04:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690492#M53533</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2021-12-12T05:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mapping export not behaving as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690493#M53534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luke,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are no changes in codes when i alter between inside/outside of ArcMap. Both are as follows.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE style="color: #000000; background-color: #ffffff; border-style: initial; border-color: initial; font-size: 9pt; padding: 0px 0px 0px 20px;"&gt;mxdLocation=r"c:\myfolder\mymap.mxd"&lt;/PRE&gt;&lt;PRE style="color: #000000; background-color: #ffffff; border-style: initial; border-color: initial; font-size: 9pt; padding: 0px 0px 0px 20px;"&gt;mxd = arcpy.mapping.MapDocument(mxdLocation)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 15:11:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-mapping-export-not-behaving-as-expected/m-p/690493#M53534</guid>
      <dc:creator>Kah_SiongTan</dc:creator>
      <dc:date>2016-12-01T15:11:10Z</dc:date>
    </item>
  </channel>
</rss>

