I am making a feature layer and applying an expression to essentially apply a definition query to the source feature class. I then want to add the created feature layer to the map. I am aware of
addDataFromPath but I don't want to add the entire feature class. I want to add the layer with a definition query applied. I could save the new layer to file and add it that way but it seems redundant to have the feature class as well as its subset stored on file. Does anyone know how I can add this type of layer to the map in ArcGIS Pro?
c_project=arcpy.mp.ArcGISProject("current") c_map=c_project.listMaps() arcpy.MakeFeatureLayer_management ("pts","pts_layer", 'Solution = 1')