<?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: create extent indicator using arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1515132#M71208</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/619517"&gt;@masa&lt;/a&gt;&amp;nbsp;I believe the issue is that you don't have ei_cim.symbol or ei_cim.pointSymbol defined.&amp;nbsp; It will require much more code to define these because multiple CIM classes are required to construct them from scratch.&amp;nbsp; This is a classic example of where the Layout or MapFrame objects could use a helper function to insert an extent indicator, especially now that new layouts can be created.&amp;nbsp; I would suggest adding an Esri Idea requesting this exact functionality.&amp;nbsp; If you are not creating a layout in your script, it may be a lot easier to modify an already existing extent indicator.&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams.&lt;/P&gt;&lt;P&gt;I'll see if I can come up with a CIM solution later.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 19:05:47 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2024-08-05T19:05:47Z</dc:date>
    <item>
      <title>create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1514200#M71197</link>
      <description>&lt;P&gt;Hello everybody,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create an extent indicator by using arcpy. Here is an example how it should look like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="masa_0-1722609811505.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111458i5C86890A0C2402B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="masa_0-1722609811505.png" alt="masa_0-1722609811505.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I know I have to use CIM for the solution but&amp;nbsp;I have difficulties understanding the documentation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code snippet I have tried out so far. As a result, no extent indicator is displayed at all. I have also swapped both map frames with each other and assigned ei_cim.sourceMapFrame = mf_main instead of ei_cim.sourceMapFrame = mf_main.name, but it doesn't help:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Extent Indicator wird gesetzt 
lyt_cim = lyt.getDefinition('V2') 
ei_cim = arcpy.cim.CreateCIMObjectFromClassName('CIMExtentIndicator', 'V2')
ei_cim.sourceMapFrame = mf_main.name
ei_cim.extentIndicatorType = "Frame"
ei_cim.isVisible = True
ei_cim.name = "extent_indicator"

lyt_cim.elements[7].extentIndicators.insert(0, ei_cim)

lyt.setDefinition(lyt_cim)&lt;/LI-CODE&gt;&lt;P&gt;lyt_cim.elements[7] is the second mapframe element.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 14:50:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1514200#M71197</guid>
      <dc:creator>masa</dc:creator>
      <dc:date>2024-08-02T14:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1514496#M71202</link>
      <description>&lt;P&gt;This is actually something that could be accomplished pretty trivially using a map series if you have access to ArcPro. Just set up a series for the overview then link the second map to the primary map series and have it linked to the center.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 00:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1514496#M71202</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2024-08-03T00:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1515132#M71208</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/619517"&gt;@masa&lt;/a&gt;&amp;nbsp;I believe the issue is that you don't have ei_cim.symbol or ei_cim.pointSymbol defined.&amp;nbsp; It will require much more code to define these because multiple CIM classes are required to construct them from scratch.&amp;nbsp; This is a classic example of where the Layout or MapFrame objects could use a helper function to insert an extent indicator, especially now that new layouts can be created.&amp;nbsp; I would suggest adding an Esri Idea requesting this exact functionality.&amp;nbsp; If you are not creating a layout in your script, it may be a lot easier to modify an already existing extent indicator.&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams.&lt;/P&gt;&lt;P&gt;I'll see if I can come up with a CIM solution later.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 19:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1515132#M71208</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2024-08-05T19:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1515168#M71209</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/619517"&gt;@masa&lt;/a&gt;&amp;nbsp;here is some sample code to at least create the ei_cim.symbol.&amp;nbsp; PointSymbol still needs to be defined if needed. Lines 6-26 below were added.&amp;nbsp; I also altered how I'm finding the locator map frame in the CIM elements list instead of hard coding an index number (line 38-40).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts()[0]
mf = lyt.listElements('MapFrame_Element', 'Main MF')[0] 
lyt_cim = lyt.getDefinition('V3')

#Create Polygon Symbol with solid stroke outline and transparenent fill
polyStrokeRGBColor = arcpy.cim.CreateCIMObjectFromClassName('CIMRGBColor', 'V3')
polyStrokeRGBColor.values = [0, 0, 0, 100]

polySymLyr1 = arcpy.cim.CreateCIMObjectFromClassName('CIMSolidStroke', 'V3')
polySymLyr1.capStyle = "Round"
polySymLyr1.joinStyle = "Round"
polySymLyr1.width = 1
polySymLyr1.color = polyStrokeRGBColor

polyFillRGBColor = arcpy.cim.CreateCIMObjectFromClassName('CIMRGBColor', 'V3')
polyFillRGBColor.values = [0, 0, 0, 0] 

polySymLyr2 = arcpy.cim.CreateCIMObjectFromClassName('CIMSolidFill', 'V3')
polySymLyr2.color = polyFillRGBColor

polySym = arcpy.cim.CreateCIMObjectFromClassName('CIMPolygonSymbol', 'V3')
polySym.symbolLayers = [polySymLyr1, polySymLyr2]

polySymRef = arcpy.cim.CreateCIMObjectFromClassName('CIMSymbolReference', 'V3')
polySymRef.symbol = polySym


#Create Extent indicator
ei_cim = arcpy.cim.CreateCIMObjectFromClassName('CIMExtentIndicator', 'V3')
ei_cim.sourceMapFrame = mf.name
ei_cim.extentIndicatorType = "Frame"
ei_cim.isVisible = True
ei_cim.name = "extent_indicator"
ei_cim.symbol = polySymRef
#ei_cim.pointSymbol = ptSymRef

for elm in lyt_cim.elements:
    if elm.name == 'Locator MF':
        elm.extentIndicators.insert(0, ei_cim)

#Set back to layer
lyt.setDefinition(lyt_cim)&lt;/LI-CODE&gt;&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 20:25:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1515168#M71209</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2024-08-05T20:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1517286#M71231</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggested solution!&lt;/P&gt;&lt;P&gt;Unfortunately, we are still working with version 2.8 at my company, which is why I also have to use version 2 for CIM. So I tried to adapt your solution to version 2, unfortunately without success.&lt;/P&gt;&lt;P&gt;Here is my adaptation:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;version_cim = "V2"
lyt_cim = lyt.getDefinition(version_cim)

#Create Polygon Symbol with solid stroke outline and transparenent fill
polyStrokeRGBColor = arcpy.cim.CreateCIMObjectFromClassName('CIMRGBColor', version_cim)
polyStrokeRGBColor.values = [237, 122, 14, 100]

polySymLyr1 = arcpy.cim.CreateCIMObjectFromClassName('CIMSolidStroke', version_cim)
polySymLyr1.capStyle.LineCapStyle = 2
polySymLyr1.joinStyle.LineJoinStyle = 1
polySymLyr1.width = 2
polySymLyr1.color = polyStrokeRGBColor

polyFillRGBColor = arcpy.cim.CreateCIMObjectFromClassName('CIMRGBColor', version_cim)
polyFillRGBColor.values = [0, 0, 0, 0] 

polySymLyr2 = arcpy.cim.CreateCIMObjectFromClassName('CIMSolidFill', version_cim)
polySymLyr2.color.values = polyFillRGBColor

polySym = arcpy.cim.CreateCIMObjectFromClassName('CIMPolygonSymbol', version_cim)
polySym.symbolLayers = [polySymLyr1, polySymLyr2]

polySymRef = arcpy.cim.CreateCIMObjectFromClassName('CIMSymbolReference', version_cim)
polySymRef.symbol = polySym

#Create Extent indicator
ei_cim = arcpy.cim.CreateCIMObjectFromClassName('CIMExtentIndicator', version_cim)
ei_cim.sourceMapFrame = mf_main.name
ei_cim.extentIndicatorType = "Frame"
ei_cim.isVisible = True
ei_cim.name = "extent_indicator"
ei_cim.symbol = polySymRef

for elm in lyt_cim.elements:
   if elm.name == 'Map Frame Minimap':
      elm.extentIndicators.insert(0, ei_cim)

#Set back to layer
lyt.setDefinition(lyt_cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;In Debugger everything looks fine but in the corresponding APRX (which I save at the end of my code) nothing at all is displayed by an extent indicator.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I'm missing some little thing. Maybe you or someone else has an idea what the problem could be?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 06:56:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1517286#M71231</guid>
      <dc:creator>masa</dc:creator>
      <dc:date>2024-08-09T06:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1517742#M71234</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/619517"&gt;@masa&lt;/a&gt;&amp;nbsp;I tried your code on my Pro 3.3 machine, even with V2 and it worked.&amp;nbsp; I would recommend trying on a more current build of Pro.&amp;nbsp; There have been 5 new releases plus many patches since 2.8.&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 21:25:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1517742#M71234</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2024-08-09T21:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: create extent indicator using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1518239#M71239</link>
      <description>&lt;P&gt;ok thanks for the feedback &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;. Updating to a newer version does not work so quickly at my company. But then I assume that it is due to an outdated version. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 09:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-extent-indicator-using-arcpy/m-p/1518239#M71239</guid>
      <dc:creator>masa</dc:creator>
      <dc:date>2024-08-12T09:44:01Z</dc:date>
    </item>
  </channel>
</rss>

