<?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: How to automate map generation using arcpy in ArcMap in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-automate-map-generation-using-arcpy-in/m-p/1037779#M60447</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to have the elements already added to the map. Then, you can manipulates its properties.&lt;/P&gt;&lt;P&gt;Check this one:&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.7/analyze/arcpy-mapping/mapsurroundelement-class.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/10.7/analyze/arcpy-mapping/mapsurroundelement-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 19:32:01 GMT</pubDate>
    <dc:creator>nita14</dc:creator>
    <dc:date>2021-03-17T19:32:01Z</dc:date>
    <item>
      <title>How to automate map generation using arcpy in ArcMap</title>
      <link>https://community.esri.com/t5/python-questions/how-to-automate-map-generation-using-arcpy-in/m-p/589896#M46243</link>
      <description>&lt;P&gt;I have prepared a python toolbox in ArcMap 10.7 which finally gives a raster layer (vulnerability index) as an output. I update the symbology which needs to be used for the map.&amp;nbsp;I wish to automate map generation (The map should contain the north arrow, legend, scale bar, and title of the map. The final is exporting it to JPEG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is, I am not able to add any elements to the map. I don't even know where to start. Could someone please help me!&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# For displaying the results in arcmap&lt;BR /&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd, "*")[0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Adding a map layer&lt;BR /&gt;addLayer = arcpy.mapping.Layer(os.path.join(arcpy.env.workspace,"vulnerability_index"))&lt;BR /&gt;arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Updating the symbology&lt;BR /&gt;updateLayer = arcpy.mapping.ListLayers(mxd,"*",df)[0]&lt;BR /&gt;sourceLayer = arcpy.mapping.Layer(Symbology)&amp;nbsp; #Symbology is a 'DElayer' parameter which we select on the tool interface)&lt;BR /&gt;arcpy.mapping.UpdateLayer(df,updateLayer, sourceLayer, True)&lt;BR /&gt;addLayer = arcpy.mapping.Layer(os.path.join(arcpy.env.workspace,"vulnerability_index"))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;#Adding map elements&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;# Generate JPEG map&lt;BR /&gt;arcpy.mapping.ExportToJPEG(mxd, os.path.join(arcpy.env.workspace,"vulnerability_index.jpeg"),resolution=300)&lt;BR /&gt;return&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 18:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-automate-map-generation-using-arcpy-in/m-p/589896#M46243</guid>
      <dc:creator>VinayDhanvada</dc:creator>
      <dc:date>2024-07-01T18:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to automate map generation using arcpy in ArcMap</title>
      <link>https://community.esri.com/t5/python-questions/how-to-automate-map-generation-using-arcpy-in/m-p/1037779#M60447</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to have the elements already added to the map. Then, you can manipulates its properties.&lt;/P&gt;&lt;P&gt;Check this one:&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.7/analyze/arcpy-mapping/mapsurroundelement-class.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/10.7/analyze/arcpy-mapping/mapsurroundelement-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 19:32:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-automate-map-generation-using-arcpy-in/m-p/1037779#M60447</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2021-03-17T19:32:01Z</dc:date>
    </item>
  </channel>
</rss>

