<?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: Extract info about scale from specific map frame in every map in Map Series in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1278325#M67944</link>
    <description>&lt;P&gt;There could be a subtle logic error hiding in your code. I'm not familiar with arcpy.mp, but it looks like you are always grabbing the same (the first in the series) map frame and getting the scale from it, so the scale printed will always be the one of the first map frame in the series. Try confirming if this is the case with some debug print statements and if it is the case, make sure you grab the scale from each frame rather than just the first frame.&lt;BR /&gt;&lt;BR /&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Loop through each map frame in the layout
    for mf in layout.listElements("MAPFRAME_ELEMENT"):
        if mf.name == "Main Map Frame":
            scale = mf.camera.scale&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps get you unstuck!&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 16:03:34 GMT</pubDate>
    <dc:creator>HannesZiegler</dc:creator>
    <dc:date>2023-04-13T16:03:34Z</dc:date>
    <item>
      <title>Extract info about scale from specific map frame in every map in Map Series</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1268986#M66803</link>
      <description>&lt;P&gt;Hi! I'm trying to run python script in ArcGis Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to extract information about scale from specific map frame (there are few of them in the layout) in every map in Map Series. I am a new user of Arcgis Pro and python and I stuck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script I prepared prints out scale info, but it prints always the same value (= the value of scale for map, which is now displayed).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be very grateful if someone help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; arcpy&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;aprx&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.mp.ArcGISProject(&lt;/SPAN&gt;&lt;SPAN&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;aprx&lt;/SPAN&gt;&lt;SPAN&gt;.listLayouts(&lt;/SPAN&gt;&lt;SPAN&gt;"nameOfLayout"&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; &lt;SPAN&gt;not&lt;/SPAN&gt; &lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN&gt;.mapSeries &lt;/SPAN&gt;&lt;SPAN&gt;is&lt;/SPAN&gt; &lt;SPAN&gt;None&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ms&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN&gt;.mapSeries&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; &lt;SPAN&gt;ms&lt;/SPAN&gt;&lt;SPAN&gt;.enabled:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;pageName&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;ms&lt;/SPAN&gt;&lt;SPAN&gt;.pageRow.OBJECTID&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt; &lt;SPAN&gt;pageNum&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;range&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ms&lt;/SPAN&gt;&lt;SPAN&gt;.pageCount + &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ms&lt;/SPAN&gt;&lt;SPAN&gt;.currentPageNumber = &lt;/SPAN&gt;&lt;SPAN&gt;pageNum&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;mf_main&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN&gt;.listElements(&lt;/SPAN&gt;&lt;SPAN&gt;"MapFrame_Element"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Main Map Frame"&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;] ## for "Main Map Frame" I need values from all the maps in map series&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;scale&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;mf_main&lt;/SPAN&gt;&lt;SPAN&gt;.camera.scale&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;pageNum&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;scale&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 15:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1268986#M66803</guid>
      <dc:creator>HannaBarysevich</dc:creator>
      <dc:date>2023-03-17T15:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extract info about scale from specific map frame in every map in Map Series</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1278325#M67944</link>
      <description>&lt;P&gt;There could be a subtle logic error hiding in your code. I'm not familiar with arcpy.mp, but it looks like you are always grabbing the same (the first in the series) map frame and getting the scale from it, so the scale printed will always be the one of the first map frame in the series. Try confirming if this is the case with some debug print statements and if it is the case, make sure you grab the scale from each frame rather than just the first frame.&lt;BR /&gt;&lt;BR /&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Loop through each map frame in the layout
    for mf in layout.listElements("MAPFRAME_ELEMENT"):
        if mf.name == "Main Map Frame":
            scale = mf.camera.scale&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps get you unstuck!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 16:03:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1278325#M67944</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2023-04-13T16:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract info about scale from specific map frame in every map in Map Series</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1361208#M76413</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm not sure if you ever got an answer, but I had the same question and came up with this:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;lyt &lt;SPAN&gt;in &lt;/SPAN&gt;aprx.listLayouts():&lt;BR /&gt;    &lt;SPAN&gt;if not &lt;/SPAN&gt;lyt.mapSeries &lt;SPAN&gt;is None&lt;/SPAN&gt;:&lt;BR /&gt;        &lt;SPAN&gt;#print(lyt.name)&lt;BR /&gt;&lt;/SPAN&gt;        ms = lyt.mapSeries&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;ms.enabled: &lt;SPAN&gt;# checks to see if the ms is a map series&lt;BR /&gt;&lt;/SPAN&gt;            &lt;SPAN&gt;for &lt;/SPAN&gt;pageNum &lt;SPAN&gt;in &lt;/SPAN&gt;&lt;SPAN&gt;range&lt;/SPAN&gt;(&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;ms.pageCount + &lt;SPAN&gt;1&lt;/SPAN&gt;): &lt;SPAN&gt;# goes through all pages (no matter how many)&lt;BR /&gt;&lt;/SPAN&gt;                ms.currentPageNumber = pageNum &lt;SPAN&gt;# sets the "current" page with the pageCount, which is the pageNum in the iteration&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;print&lt;/SPAN&gt;((ms.pageRow.Name + &lt;SPAN&gt;" " &lt;/SPAN&gt;+ &lt;SPAN&gt;str&lt;/SPAN&gt;(pageNum))) &lt;SPAN&gt;# prints the page name (from the index layer) and the page number&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                # now goes back to the layout&lt;BR /&gt;&lt;/SPAN&gt;                mf = lyt.listElements(&lt;SPAN&gt;"MAPFRAME_ELEMENT"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"*Main*"&lt;/SPAN&gt;)[&lt;SPAN&gt;0&lt;/SPAN&gt;] &lt;SPAN&gt;# the map for the series has the word "Main" in it&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;str&lt;/SPAN&gt;(mf.camera.scale))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 22:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-info-about-scale-from-specific-map-frame/m-p/1361208#M76413</guid>
      <dc:creator>WCall</dc:creator>
      <dc:date>2023-12-14T22:31:01Z</dc:date>
    </item>
  </channel>
</rss>

