<?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 Use arcpy to set height and width for map frames in an ArcGIS Pro project in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcpy-to-set-height-and-width-for-map-frames/m-p/1388360#M79499</link>
    <description>&lt;P&gt;This snippet of code is to try and automatically update the borders and dimensions of all map frames within an ArcGIS Pro project, but I cannot figure out how to get the heights and widths of the map frames to update. The code updates the borders and does not generate any errors but nothing happens to the map frame dimensions--any input on how to do that would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')

for lyt in p.listLayouts():
    print('getting definition')
    lyt_cim = lyt.getDefinition('V2')
    mf = lyt.listElements('mapframe_element', 'Map Frame')[0]
    mf.elementWidth=6.5
    mf.elementHeight=6.5
    for elm in lyt_cim.elements:
        if type(elm).__name__ == 'CIMMapFrame':
            if elm.graphicFrame.borderSymbol.symbol.symbolLayers:
                sym = elm.graphicFrame.borderSymbol.symbol.symbolLayers[0]
                sym.width = 0
                print('setting definition')
                lyt.setDefinition(lyt_cim)
        else:
            print(elm.name + ' has NO symbol layers')
p.save()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 22:10:33 GMT</pubDate>
    <dc:creator>NSamu</dc:creator>
    <dc:date>2024-02-28T22:10:33Z</dc:date>
    <item>
      <title>Use arcpy to set height and width for map frames in an ArcGIS Pro project</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcpy-to-set-height-and-width-for-map-frames/m-p/1388360#M79499</link>
      <description>&lt;P&gt;This snippet of code is to try and automatically update the borders and dimensions of all map frames within an ArcGIS Pro project, but I cannot figure out how to get the heights and widths of the map frames to update. The code updates the borders and does not generate any errors but nothing happens to the map frame dimensions--any input on how to do that would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')

for lyt in p.listLayouts():
    print('getting definition')
    lyt_cim = lyt.getDefinition('V2')
    mf = lyt.listElements('mapframe_element', 'Map Frame')[0]
    mf.elementWidth=6.5
    mf.elementHeight=6.5
    for elm in lyt_cim.elements:
        if type(elm).__name__ == 'CIMMapFrame':
            if elm.graphicFrame.borderSymbol.symbol.symbolLayers:
                sym = elm.graphicFrame.borderSymbol.symbol.symbolLayers[0]
                sym.width = 0
                print('setting definition')
                lyt.setDefinition(lyt_cim)
        else:
            print(elm.name + ' has NO symbol layers')
p.save()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 22:10:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-arcpy-to-set-height-and-width-for-map-frames/m-p/1388360#M79499</guid>
      <dc:creator>NSamu</dc:creator>
      <dc:date>2024-02-28T22:10:33Z</dc:date>
    </item>
  </channel>
</rss>

