<?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: Using CIMSpatialMapSeries, to set Scale for 'Center and Maintain Scale' map extent? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621236#M96374</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/177716"&gt;@JasonBennett&lt;/a&gt;&amp;nbsp;,&amp;nbsp; I just tried the following and it works for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find the best approach to learning where stuff is persisted in the CIM is to create a before and after result that can be compared using an application that shows differences (e.g. WinMerge).&amp;nbsp; So what I did first was export my Best Fit map series to a PAGX file.&lt;/P&gt;&lt;P&gt;Then I changed my options to use Center and Maintain Scale and exported to a PAGX again with a different name.&lt;/P&gt;&lt;P&gt;I use WinMerge to compare the two text files (tip, if you rename the *.pagx to *.json, the formatting may look cleaner).&amp;nbsp; When I compare the differences, I see that the map series CIM has a "extentOptions" property and I changed it from "BestFit" to the "ExtentCenter" enum.&amp;nbsp; Then I updated the map series mapframe camera scale property.&lt;/P&gt;&lt;P&gt;Here is the code I used to make the changed to my map series.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Reference project and layout
p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts('*_MS')[0]

#First, change the map series extent option
ms = lyt.mapSeries
ms_cim = ms.getDefinition('V3')
ms_cim.extentOptions = 'ExtentCenter'  #Center and Maintain Scale
ms.setDefinition(ms_cim)

#Now change the scale of the map frame (via the camera object)
mf = lyt.listElements('mapframe_element', 'Map Frame')[0]
cam = mf.camera.scale
cam.scale = 5000000&lt;/LI-CODE&gt;&lt;P&gt;I hope this was helpful,&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp team&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 16:21:38 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2025-06-05T16:21:38Z</dc:date>
    <item>
      <title>Using CIMSpatialMapSeries, to set Scale for 'Center and Maintain Scale' map extent?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1620966#M96349</link>
      <description>&lt;P data-unlink="true"&gt;I'm&amp;nbsp;programmatically creating a map series layout in ArcGIS Pro using &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_self"&gt;CIM&lt;/A&gt;. I can enable the map series, set the map frame, layer, name &amp;amp; sort fields and set the extent options any way I choose via code. However, I cannot find a property to set the Scale under Center and Maintain Scale. See image.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JasonBennett_0-1749064560081.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133798i533ED368CFB28C39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JasonBennett_0-1749064560081.png" alt="JasonBennett_0-1749064560081.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find 'Scale' in the &lt;A href="https://github.com/Esri/cim-spec/blob/main/docs/v3/CIMLayout.md#cimspatialmapseries-1" target="_self"&gt;documentation&lt;/A&gt;. There is 'scaleRounding', but that only affects 'Round up scale to nearest ##' under Best Fit Extent.&lt;/P&gt;&lt;P&gt;This is my code. It works. I just can't change the Scale...&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def enable_plan_view_map_series(aprx, map_name, layer_name, layout_name, map_frame_name, start_page):
    layer_URI, layout, layout_cim = get_layer_cim_definition(aprx, map_name, layer_name, layout_name)

    #Create CIM Spatial Map Series Object and populate its properties
    ms = arcpy.cim.CreateCIMObjectFromClassName('CIMSpatialMapSeries', 'V3')
    ms.enabled = True
    ms.mapFrameName = map_frame_name
    ms.startingPageNumber = start_page
    ms.currentPageID = start_page
    ms.indexLayerURI = layer_URI                    #Index layer URI from Layer's CIM 
    ms.nameField = "Sheet_Name"
    ms.sortField = "Sheet_Num"
    ms.sortAscending = True
    ms.extentOptions = "ExtentCenter"

    layout_cim.mapSeries = ms                       #Set new map series to layout
    layout.setDefinition(layout_cim)                #Set the Layout's CIM definition

    #Force a refresh of the layout and its associated panes
    layout_cim = layout.getDefinition('V3')
    layout.setDefinition(layout_cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 19:25:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1620966#M96349</guid>
      <dc:creator>JasonBennett</dc:creator>
      <dc:date>2025-06-04T19:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using CIMSpatialMapSeries, to set Scale for 'Center and Maintain Scale' map extent?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621236#M96374</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/177716"&gt;@JasonBennett&lt;/a&gt;&amp;nbsp;,&amp;nbsp; I just tried the following and it works for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find the best approach to learning where stuff is persisted in the CIM is to create a before and after result that can be compared using an application that shows differences (e.g. WinMerge).&amp;nbsp; So what I did first was export my Best Fit map series to a PAGX file.&lt;/P&gt;&lt;P&gt;Then I changed my options to use Center and Maintain Scale and exported to a PAGX again with a different name.&lt;/P&gt;&lt;P&gt;I use WinMerge to compare the two text files (tip, if you rename the *.pagx to *.json, the formatting may look cleaner).&amp;nbsp; When I compare the differences, I see that the map series CIM has a "extentOptions" property and I changed it from "BestFit" to the "ExtentCenter" enum.&amp;nbsp; Then I updated the map series mapframe camera scale property.&lt;/P&gt;&lt;P&gt;Here is the code I used to make the changed to my map series.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Reference project and layout
p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts('*_MS')[0]

#First, change the map series extent option
ms = lyt.mapSeries
ms_cim = ms.getDefinition('V3')
ms_cim.extentOptions = 'ExtentCenter'  #Center and Maintain Scale
ms.setDefinition(ms_cim)

#Now change the scale of the map frame (via the camera object)
mf = lyt.listElements('mapframe_element', 'Map Frame')[0]
cam = mf.camera.scale
cam.scale = 5000000&lt;/LI-CODE&gt;&lt;P&gt;I hope this was helpful,&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp team&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 16:21:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621236#M96374</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2025-06-05T16:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using CIMSpatialMapSeries, to set Scale for 'Center and Maintain Scale' map extent?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621271#M96376</link>
      <description>&lt;P&gt;I never thought to compare changes like that! This makes it so much easier to what I'm looking for. Thanks for your help. This worked perfectly!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 18:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621271#M96376</guid>
      <dc:creator>JasonBennett</dc:creator>
      <dc:date>2025-06-05T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using CIMSpatialMapSeries, to set Scale for 'Center and Maintain Scale' map extent?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621283#M96377</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/177716"&gt;@JasonBennett&lt;/a&gt;&amp;nbsp;I'm glad it worked.&amp;nbsp; Comparing the before and after is super useful especially if you minimize the changes to the absolute necessary steps between saves.&amp;nbsp; Sometime you might see new objects are introduced and that is when you would might need to use&amp;nbsp;&lt;SPAN&gt;CreateCIMObjectFromClassName.&amp;nbsp; It is covered in this topic:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 18:20:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-cimspatialmapseries-to-set-scale-for-center/m-p/1621283#M96377</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2025-06-05T18:20:48Z</dc:date>
    </item>
  </channel>
</rss>

