The section Additional Resources and Sample Scripts links to the GitHub repository and a sample project with a script to create a dashed effect:
# Author: Esri # Date: March 2020 # Version: ArcGISPro 2.5 # Purpose: This script creates or modifies the dash effects for a line symbol. # Notes: - The script is intended to work from a script tool provided with # a sample project using "CURRENT". To see the changes happen be # sure to activate the appropriate map or layout. # - In addition to this sample script demonstating how the CIM # provides access to capabilities not in the managed Python API, # is also demonstrates a method for creating CIM objects that are # necessary to set desired properties. p = arcpy.mp.ArcGISProject('current') m = p.listMaps('Symbology') l = m.listLayers('States_SingleSymbol') l_cim = l.getDefinition('V2') #Get the Layer's CIM definition #Symbol Level 1 (Solid Stroke) symLvl1 = l_cim.renderer.symbol.symbol.symbolLayers #If a dashed effect does not exist, create one if len(symLvl1.effects) == 0: newDash = arcpy.cim.CreateCIMObjectFromClassName('CIMGeometricEffectDashes', 'V2') newDash.dashTemplate = [5, 5] symLvl1.effects = [newDash] #If a dashed effects does exist, modify it else: dash = symLvl1.effects dash.dashTemplate = [10, 10] l.setDefinition(l_cim) #Set the Layer's CIM definition
This serves as a good starting point. Do you know of an easy way to expose the JSON structure of existing symbol styles? Or how to gain insight into the hierarchy?