AnsweredAssumed Answered

How to get a layer object from input parameter by arcpy?

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

Hello, I am wondering how I can get the layer object from a shapefile. In ArcMap, it is pretty easy. I  can use:

route_temp = arcpy.GetParameterAsText(0)

route_temp_lyr = arcpy.mapping.Layer(route_temp)
working_f = os.path.split(route_temp_lyr.dataSource)[0]

But how I can do it in ArcGIS Pro? I want to get the layer object from my input parameter.