<?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: count of maps in Arcpro project in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158240#M64173</link>
    <description>&lt;P&gt;It will come back to haunt people at some point&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oops.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37441iEB3E1296C19928C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oops.png" alt="oops.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;works for some isn't a good idea&lt;/P&gt;</description>
    <pubDate>Mon, 28 Mar 2022 02:31:11 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-03-28T02:31:11Z</dc:date>
    <item>
      <title>count of maps in Arcpro project</title>
      <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158220#M64167</link>
      <description>&lt;P&gt;Hello, I have a arcpro project and inside the projects, i have 2 maps and and each map 3 layers. I want to print the number of maps and and number of layers within each maps. i have this so far and i am getting errors. any tips ?&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;aprx_path = "C:/.colorado.aprx"&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(aprx_path)&lt;/P&gt;&lt;P&gt;maps = aprx.listMaps()&lt;/P&gt;&lt;P&gt;for m in maps:&lt;BR /&gt;&lt;BR /&gt;print(m.count)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2022 22:36:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158220#M64167</guid>
      <dc:creator>AmandaYoung_95</dc:creator>
      <dc:date>2022-03-27T22:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: count of maps in Arcpro project</title>
      <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158226#M64168</link>
      <description>&lt;P&gt;The error message would help.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"C:/.colorado.aprx"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;will fail, if that is the path since an aprx can't exist in the root directory nor begin with punctuation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also your formatting could use line numbers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2022 23:52:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158226#M64168</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-03-27T23:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: count of maps in Arcpro project</title>
      <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158231#M64169</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;listMaps()&lt;/STRONG&gt; method gives you a &lt;EM&gt;list&lt;/EM&gt;. Simply call &lt;STRONG&gt;len(maps) &lt;/STRONG&gt;to get the count. The code you have written is attempting to access a &lt;STRONG&gt;count&lt;/STRONG&gt; property of each individual map and print it, but no such property exists, at least in my maps.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1648427495544.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37439i803F39380CF59A63/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1648427495544.png" alt="jcarlson_0-1648427495544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To get your layer counts per map, you just do the same thing, but with the output of the map's &lt;STRONG&gt;listLayers() &lt;/STRONG&gt;method.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print(f'{len(aprx.listMaps())} maps in project.')

for m in aprx.listMaps():
    print(f'{len(m.listLayers())} layers in {m.name}')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 00:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158231#M64169</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-28T00:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: count of maps in Arcpro project</title>
      <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158235#M64171</link>
      <description>&lt;P&gt;Maybe that changed in a recent version?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1648431789079.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37440i225409E7F1FCF63A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1648431789079.png" alt="jcarlson_0-1648431789079.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Seems to work just fine. Not that it's a good idea, but it seems to be "legal".&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 01:43:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158235#M64171</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-28T01:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: count of maps in Arcpro project</title>
      <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158236#M64172</link>
      <description>&lt;P&gt;thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 02:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158236#M64172</guid>
      <dc:creator>AmandaYoung_95</dc:creator>
      <dc:date>2022-03-28T02:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: count of maps in Arcpro project</title>
      <link>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158240#M64173</link>
      <description>&lt;P&gt;It will come back to haunt people at some point&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oops.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37441iEB3E1296C19928C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oops.png" alt="oops.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;works for some isn't a good idea&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 02:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/count-of-maps-in-arcpro-project/m-p/1158240#M64173</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-03-28T02:31:11Z</dc:date>
    </item>
  </channel>
</rss>

