Hello,
I try to set the extent of a map in a aprx by setting the definition of this one. I want to set by setting the defautExtent parameter with a CIM object. Here is my code I want to proceed but it is unsucessful :
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('*')[0]
m_cim = m.getDefinition('V2') #Get the Map's CIM definition
extent = m.listLayers('*')[0].getExtent()
CimExtent = arcpy.cim.CreateCIMObjectFromClassName('CIMExtentIndicator', 'V2')
CimExtent .values = extent
m_cim.defaultExtent = RGBColor
m.setDefinition(m_cim)
p.save()
Does the CIMExtentIndicator is the good object type to set the extent of the map.
Thank you