Hi community,
any idea how I can set the property "Scale Symbols" of a layer to true or false?
I didn't find anything in the doc.
Regards,
Daniel.
Solved! Go to Solution.
not everything is exposed
Python CIM access—ArcGIS Pro | Documentation
so you have to look carefully
"layerDefinitions" : [
    {
      "type" : "CIMFeatureLayer",
      "name" : "GreatLakes",
      "uRI" : "CIMPATH=map/greatlakes.xml",
      "useSourceMetadata" : true,
      "description" : "GreatLakes",
      "layerType" : "Operational",
      "showLegends" : true,
      "visibility" : true,
      "displayCacheType" : "Permanent",
      "maxDisplayCacheAge" : 5,
      "showPopups" : true,
      "serviceLayerID" : -1,
      "autoGenerateFeatureTemplates" : true,
      "featureElevationExpression" : "0",
      "featureTable" : {
      "htmlPopupEnabled" : true,
      "selectable" : true,
      "featureCacheType" : "Session",
      "scaleSymbols" : true,
      "snappable" : true.... notice line 21
not everything is exposed
Python CIM access—ArcGIS Pro | Documentation
so you have to look carefully
"layerDefinitions" : [
    {
      "type" : "CIMFeatureLayer",
      "name" : "GreatLakes",
      "uRI" : "CIMPATH=map/greatlakes.xml",
      "useSourceMetadata" : true,
      "description" : "GreatLakes",
      "layerType" : "Operational",
      "showLegends" : true,
      "visibility" : true,
      "displayCacheType" : "Permanent",
      "maxDisplayCacheAge" : 5,
      "showPopups" : true,
      "serviceLayerID" : -1,
      "autoGenerateFeatureTemplates" : true,
      "featureElevationExpression" : "0",
      "featureTable" : {
      "htmlPopupEnabled" : true,
      "selectable" : true,
      "featureCacheType" : "Session",
      "scaleSymbols" : true,
      "snappable" : true.... notice line 21
Thanks a lot for the hint!
I have done it now the following way:
project = arcpy.mp.ArcGISProject("current")
map = project.listMaps("Map")[0]
layer = map.listLayers(...)[0]
l_cim = layer.getDefinition("V2")
l_cim.scaleSymbols = False
l_cim.visibility = False
layer.setDefinition(l_cim)Regards,
Daniel.
