<?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>idea Change scale bar properties with Python in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idi-p/949564</link>
    <description>&lt;P&gt;I want to be able to access and alter scale bar properties such as division values, division numbers, and units via Python.&amp;nbsp; An ESRI staff member on the &lt;A href="http://forums.arcgis.com/threads/13194-Changing-scale-bar-properties-with-arcpy" target="_blank" rel="noopener"&gt;ArcObjects forum&lt;/A&gt; says it can't be done... yet.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2022 16:06:59 GMT</pubDate>
    <dc:creator>ShannonDeArmond</dc:creator>
    <dc:date>2022-08-12T16:06:59Z</dc:date>
    <item>
      <title>Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idi-p/949564</link>
      <description>&lt;P&gt;I want to be able to access and alter scale bar properties such as division values, division numbers, and units via Python.&amp;nbsp; An ESRI staff member on the &lt;A href="http://forums.arcgis.com/threads/13194-Changing-scale-bar-properties-with-arcpy" target="_blank" rel="noopener"&gt;ArcObjects forum&lt;/A&gt; says it can't be done... yet.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 16:06:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idi-p/949564</guid>
      <dc:creator>ShannonDeArmond</dc:creator>
      <dc:date>2022-08-12T16:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949565#M6877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;This would help me a lot. I&amp;nbsp;currently have multiple scale bars in one Data Driven Pages MXD that are positioned according to the current scale. It would be nice to just have one that changed the division values and numbers dynamically.

&lt;!-- content transformation source ID: 00a3000000A8FdJ --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 18:57:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949565#M6877</guid>
      <dc:creator>TannerSemerad1</dc:creator>
      <dc:date>2011-05-17T18:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949566#M6878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yep. Been waiting for this for years now.

&lt;!-- content transformation source ID: 00a3000000EcglY --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 02:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949566#M6878</guid>
      <dc:creator>ShannonDeArmond</dc:creator>
      <dc:date>2012-03-13T02:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949567#M6879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I did a custom PrintSOE which has this feature:&lt;BR /&gt;&amp;nbsp;&lt;A href="http://www.arcgis.com/home/item.html?id=6809086326ea4c76bf026a32bb9dd698" target="_blank"&gt;http://www.arcgis.com/home/item.html?id=6809086326ea4c76bf026a32bb9dd698&lt;BR /&gt;&lt;BR /&gt;M&lt;/A&gt;ay be this can help you until Esri has implemented this feature

&lt;!-- content transformation source ID: 00a3000000Echls --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 08:33:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949567#M6879</guid>
      <dc:creator>TomSchuller</dc:creator>
      <dc:date>2012-03-13T08:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949568#M6880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I need this to be possible, make map automation much cleaner and make for much better and appropriate cartography.

&lt;!-- content transformation source ID: 00aE0000004OFEY --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 20:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949568#M6880</guid>
      <dc:creator>JoshJones1</dc:creator>
      <dc:date>2014-01-14T20:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949569#M6881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;+100 The ability to dynamically set the properties of a scale bar is paramount in managing advanced webprinting and geoprocessing. Currently we have to setup (and manage!) multiple mxds at slightly different scale settings to ensure that the scale bars and grids/graticules* are actually useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*the ability to set the grid/graticule division through arcpy.mapping is also sorely needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 20:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949569#M6881</guid>
      <dc:creator>TimBarnes</dc:creator>
      <dc:date>2016-06-29T20:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949570#M6882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just curious what the hold up is for ESRI to implement this? &amp;nbsp;Seems like a request that has been around for awhile now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949570#M6882</guid>
      <dc:creator>SolanaFoo4</dc:creator>
      <dc:date>2017-04-19T17:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949571#M6883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I spoke to a couple of folks on the ESRI arcpy.mapping team about this at UC a couple of years ago. The party line seemed to be that ESRI didn't want to reinvent everything for python that was already available in ArcObjects. I keep hoping if we bug them enough it might happen though. I have to maintain a handful of templates with about 20 named scale bars each to get around this problem, which is kind of ridiculous if you ask me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:35:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/949571#M6883</guid>
      <dc:creator>ShannonDeArmond</dc:creator>
      <dc:date>2017-04-19T17:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change scale bar properties with Python - Status changed to: Already Offered</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/1202412#M20818</link>
      <description>&lt;P&gt;Hello everyone and thank you for your feedback! I missed this thread because it wasn't labelled arcpy.mp.&amp;nbsp; We exposed Python CIM Access to be able to accommodate these finer grained requests.&amp;nbsp; Please review this topic:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;You should be able to accomplish now using arcpy.mp and CIM access. Also in the pipeline on the Layout team (post 3.1) that you might find useful is we plan on adding scale thresholds to layout map surrounds elements so, for example, you can have multiple, stacked scalebars with different settings, scale will control visibility and if you sent the thresholds up correctly, just one scale bar would display at a time.&lt;/P&gt;&lt;P&gt;As for arcpy, here is a script from a downloadable sample that has 30 CIM snippets.&amp;nbsp; I modified it slightly to also update divisions and subdivisions I saw mentioned in the thread.&amp;nbsp; Here is a before and after scale bar.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48522iB861716BC849574F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 370px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48523iB7305BBA993BFB28/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Code sample:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;p = arcpy.mp.ArcGISProject('current')&lt;BR /&gt;lyt = p.listLayouts('GreatLakes')[0]&lt;/P&gt;&lt;P&gt;lyt_cim = lyt.getDefinition("V2") #Get the layout's CIM definition&lt;/P&gt;&lt;P&gt;#Iterate though all layout elements to find the ScaleBar element&lt;BR /&gt;for elm in lyt_cim.elements:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if elm.name == "Scale Bar":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #Change the number of divisions and subdivision&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elm.divisions = 3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elm.subdivisions = 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #Flip the scale bar so markers and labels appear below the line&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elm.labelPosition = "Below"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elm.markPosition = "Below"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #Remove the first midpoint division label by labeling only divisions&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elm.labelFrequency = "Divisions"&lt;/P&gt;&lt;P&gt;lyt.setDefinition(lyt_cim) #Set the layout's CIM definition&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The CIM samples can be located here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://esriurl.com/arcpy.mp/samples" target="_blank"&gt;https://esriurl.com/arcpy.mp/samples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then scroll to the one called CIM Samples&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 15:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/change-scale-bar-properties-with-python/idc-p/1202412#M20818</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-08-12T15:22:44Z</dc:date>
    </item>
  </channel>
</rss>

