<?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: Clip Output to Graphics Extent with arcpy in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323442#M3404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had the same issue.&amp;nbsp; I was using the clip output to graphics extent in the tool and wanted to automate the process.&amp;nbsp; I'm creating map graphics for reports and PPTs.&amp;nbsp; I use the clip graphics function because I don't want the extra white space around my graphic.&amp;nbsp; To get around this in Arcpy I resized my layout.&amp;nbsp; Under page and print layout I unchecked the use printer paper settings option.&amp;nbsp; Then I moved my dataframe and layout items to an origin of 0, 0 on the Size and Position properties tab.&amp;nbsp; This essentially eliminates the "margin" that is needed for printing to paper.&amp;nbsp; This works for me because I'm just exporting the maps to graphics.&amp;nbsp; The downside is if you want to print the mxd you'll likely lose the edge of your map because there is no longer a margin.&amp;nbsp; I guess if you do it this way you don't really need the clip output option in the Arcpy function but it still would be nice to have the option.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2012 16:19:55 GMT</pubDate>
    <dc:creator>NilsBabel</dc:creator>
    <dc:date>2012-03-23T16:19:55Z</dc:date>
    <item>
      <title>Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323436#M3398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When exporting a map from layout in ArcMap there is an option to "Clip Output to Graphics Extent". Is it possible to automate this function with arcpy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jane&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 01:41:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323436#M3398</guid>
      <dc:creator>JaneWickers</dc:creator>
      <dc:date>2010-11-17T01:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323437#M3399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jane,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This option is not available in with the arcpy.mapping Export functions.&amp;nbsp; I'd like to know more about how you use this and why.&amp;nbsp; I also recommend that you add this to the &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com"&gt;http://ideas.arcgis.com&lt;/A&gt;&lt;SPAN&gt; website.&amp;nbsp; It may be possible to add in a future release but we'd really like to know the use cases in terms of map automation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 14:10:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323437#M3399</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2010-11-17T14:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323438#M3400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jeff. I am creating a tool where the user inputs a Property Number, Scale and Description. The mxd then zooms to that Property at the scale nominated and outputs to a pdf. The user who has requested this tool frequently uses the Clip Output to Graphics Extent to export to the pdf. She has asked me to incorporate this into my tool (using arcy).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jane&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 02:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323438#M3400</guid>
      <dc:creator>JaneWickers</dc:creator>
      <dc:date>2010-11-19T02:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323439#M3401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also need this functionality. We create a tax map book application on CD that has to be completely functional without access to the internet. The website has images that I export from ArcMap as a png that has corresponding rollover hotspots for the townships and the map book pages. For duplication purposes (we build this application for every revenue year), it is critical that the exported images are clipped to the graphics extent or the rollovers will not line up on the images. This is the only process holdng me up from running a python script to completely automate the process of building the application every year. I have to manually export nearly 40 images before i can run my script and the application gets built. I hope this functionality gets implimented in the next release.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 17:41:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323439#M3401</guid>
      <dc:creator>Kathleen_Crombez</dc:creator>
      <dc:date>2012-02-10T17:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323440#M3402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As an alternative, why can't you just use a masking layer?&amp;nbsp; The masking layer can "white out" the zone outside the area of interest before the export is done.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This can be done in the user interface with Data Driven Pages using page definitions (via the definition query tab).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or it can be done with arcpy.mapping in a similar way but by automating the updating of definition queries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 13:40:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323440#M3402</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-02-13T13:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323441#M3403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm currently working on a script for exporting ddp with a mask layer and I'm having trouble getting the definition query to update for each page as it exports.&amp;nbsp; I'd appreciate it if you could take a look and provide suggestions.&amp;nbsp; Here's the script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, sys, os
arcpy.env.overwriteOutput = True
mxd = arcpy.mapping.MapDocument("CURRENT")

print "Enter save as pdf location:"
pdfDir = arcpy.GetParameterAsText(0)
outputFolder = pdfDir + r"\PDFs"

df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
maskLayer = arcpy.mapping.ListLayers(mxd, "state_bnd110", df)[0]
maskField = "STATE_NAME"

for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp; pageName = mxd.dataDrivenPages.pageRow.STATE_NAME
&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.name == maskLayer:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.definitionQuery = '"STATE_NAME" &amp;lt;&amp;gt; %s' % pageName
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, os.path.dirname(outputFolder)+ os.sep + pageName + ".pdf")

del mxd
arcpy.GetMessages()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Karla&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323441#M3403</guid>
      <dc:creator>KarlaMayne</dc:creator>
      <dc:date>2021-12-11T15:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323442#M3404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had the same issue.&amp;nbsp; I was using the clip output to graphics extent in the tool and wanted to automate the process.&amp;nbsp; I'm creating map graphics for reports and PPTs.&amp;nbsp; I use the clip graphics function because I don't want the extra white space around my graphic.&amp;nbsp; To get around this in Arcpy I resized my layout.&amp;nbsp; Under page and print layout I unchecked the use printer paper settings option.&amp;nbsp; Then I moved my dataframe and layout items to an origin of 0, 0 on the Size and Position properties tab.&amp;nbsp; This essentially eliminates the "margin" that is needed for printing to paper.&amp;nbsp; This works for me because I'm just exporting the maps to graphics.&amp;nbsp; The downside is if you want to print the mxd you'll likely lose the edge of your map because there is no longer a margin.&amp;nbsp; I guess if you do it this way you don't really need the clip output option in the Arcpy function but it still would be nice to have the option.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 16:19:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323442#M3404</guid>
      <dc:creator>NilsBabel</dc:creator>
      <dc:date>2012-03-23T16:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323443#M3405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can "Clip to Graphics Extent" be used in a python script utilizing the ArcPy.ExportCAD_conversion method? We are trying to export DXF tiles based on a grid layer and providing an extent makes a selection of features passing through, but does not clip the output to the proper extent, resulting in features running way outside the boundaries of each tile.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 16:25:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323443#M3405</guid>
      <dc:creator>MarcCusumano</dc:creator>
      <dc:date>2012-03-23T16:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323444#M3406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;will "Clip Output to Graphics Extent" when exporting a map to pdf be included in arcpy in ver. 10.1?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And/or is it another way to clip to output extent before exporting to pdf through arcpy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 11:22:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323444#M3406</guid>
      <dc:creator>ANilsen</dc:creator>
      <dc:date>2012-06-18T11:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323445#M3407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This direct capability was not added at 10.1 but have you tried definition queries and page definitions (with DDP)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 13:49:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323445#M3407</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-06-19T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Clip Output to Graphics Extent with arcpy</title>
      <link>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323446#M3408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realize this is an old post, but not a whole lot on the internet on this topic besides this post.&amp;nbsp; Has the ability to "Clip Output to Graphics Extent" via arcpy been added to recent version of ArcMap (I have 10.4)?&amp;nbsp; I have hundreds of map documents I'd like to export as JPEGs to insert into Word documents and this would be so helpful.&amp;nbsp; I don't want the white space around the map document, just the graphic.&amp;nbsp; Based on my research, I have a sinking feeling it has not been added...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff.&amp;nbsp; Would&amp;nbsp;it be possible for you to explain in more detail how to duplicate this function using arcpy in combination with mask layers/definition queries?&amp;nbsp; I'm struggling to understand that&amp;nbsp;idea at a conceptual level, let alone a scripting level.&amp;nbsp; Thank you!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2018 15:05:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/clip-output-to-graphics-extent-with-arcpy/m-p/323446#M3408</guid>
      <dc:creator>JoshuaBrengel</dc:creator>
      <dc:date>2018-06-27T15:05:36Z</dc:date>
    </item>
  </channel>
</rss>

