<?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: Create a .mxd project from scratch via arcpy. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1226496#M65964</link>
    <description>&lt;P&gt;Apart from the blank template method, this is not possible using arcpy. This is an&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/guidelinesforarcpymapping.htm" target="_self"&gt; intentional design decision&lt;/A&gt;:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;Must work with existing map documents or layer files&lt;/STRONG&gt;&lt;BR /&gt;The arcpy.mapping module was designed so that it can be used to modify existing elements within already existing map documents (.mxd) or layer files (.lyr).&amp;nbsp; &amp;lt;...snip...&amp;gt; You must carefully author a map document or layer file using ArcMap ahead of time with all the appropriate elements and then use arcpy.mapping to manipulate its contents&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, it was possible with python by accessing ArcObjects. For more details, see &lt;A href="https://gis.stackexchange.com/a/50718/2856" target="_self"&gt;this answer&lt;/A&gt; on GIS StackExchange.&amp;nbsp; This was written quite a long time ago, I don't know if it still works.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Oct 2022 05:19:34 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2022-10-28T05:19:34Z</dc:date>
    <item>
      <title>Create a .mxd project from scratch via arcpy.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1225319#M65938</link>
      <description>&lt;P&gt;I know that right now you can't create a .mxd from scratch in ArcPy through a command line, in Python 2. You can only add layers to a .mxd.&lt;/P&gt;&lt;P&gt;Is it possible to create a function where such a document can be created from scratch?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 18:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1225319#M65938</guid>
      <dc:creator>PabloUrbinaTerán</dc:creator>
      <dc:date>2022-10-25T18:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a .mxd project from scratch via arcpy.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1225368#M65940</link>
      <description>&lt;P&gt;Does not appear to be.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have not tested it, but you might be able to make a "template" mxd that your script references, then use the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;saveACopy (file_name, {version})&lt;/PRE&gt;&lt;P&gt;to save to "new" mxd.&lt;/P&gt;&lt;P&gt;R_&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 19:38:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1225368#M65940</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-10-25T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create a .mxd project from scratch via arcpy.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1225625#M65943</link>
      <description>&lt;P&gt;I have never found a way to create one from scratch so I have to have a "blank template" available to use as the starting point.&amp;nbsp; Something like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;mxd_template_obj = arcpy.mapping.MapDocument(&amp;lt;blank_template_fn&amp;gt;)
df = arcpy.mapping.ListDataFrames(mxd_template_obj)[0] 
arcpy.mapping.AddLayer(df, &amp;lt;layer file name&amp;gt;, "BOTTOM")
mxd_template_obj.saveACopy(&amp;lt;mxd file name&amp;gt;)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 13:45:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1225625#M65943</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2022-10-26T13:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a .mxd project from scratch via arcpy.</title>
      <link>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1226496#M65964</link>
      <description>&lt;P&gt;Apart from the blank template method, this is not possible using arcpy. This is an&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/guidelinesforarcpymapping.htm" target="_self"&gt; intentional design decision&lt;/A&gt;:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;Must work with existing map documents or layer files&lt;/STRONG&gt;&lt;BR /&gt;The arcpy.mapping module was designed so that it can be used to modify existing elements within already existing map documents (.mxd) or layer files (.lyr).&amp;nbsp; &amp;lt;...snip...&amp;gt; You must carefully author a map document or layer file using ArcMap ahead of time with all the appropriate elements and then use arcpy.mapping to manipulate its contents&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, it was possible with python by accessing ArcObjects. For more details, see &lt;A href="https://gis.stackexchange.com/a/50718/2856" target="_self"&gt;this answer&lt;/A&gt; on GIS StackExchange.&amp;nbsp; This was written quite a long time ago, I don't know if it still works.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 05:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-mxd-project-from-scratch-via-arcpy/m-p/1226496#M65964</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-10-28T05:19:34Z</dc:date>
    </item>
  </channel>
</rss>

