AnsweredAssumed Answered

Appy symbology does not work with arcpy

Question asked by Fengchao on Nov 9, 2018
Latest reply on Nov 12, 2018 by Fengchao

Hello I want to load multiple shape files to the table of content and add them to a group layer in ArcGIS Pro with arcpy. Then apply the defined symbology to all these layers. What I have wrote is as below:

aprx = ("CURRENT")
aprxMap = aprx.listMaps("Map")[0]

FC5symbology = r"C:\Program Files (x86)\ArcGIS\Desktop10.5\Styles\Prep_layer_definition\retest_group_layers\ArcGIS_Pro_test\FC5_symbology.lyrx"


for lyr in aprxMap.listLayers():
    if "FC5" in and not lyr.isGroupLayer:
       aprxMap.addLayerToGroup(FC5layer, lyr, "BOTTOM")

But then I got an error.


Anyone can help me with this error. Thanks!