Adding Script Output to Map

04-09-2021 11:59 AM
Labels (1)
New Contributor


I have made a script tool which runs several geoprocessing functions in a row. The final result is a new feature class. At the end of the script I need it open the feature class, and then apply symbology from another layer.  I have not been able to get it to open a feature class in the map from within the script. I have tried several ideas from forum but have not had nay luck. Most throw errors. The following allows the program to complete but does nothing. Thanks in advance for the help.

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


0 Kudos
2 Replies
MVP Esteemed Contributor

MakeFeatureLayer  is the usual way

Make Feature Layer (Data Management)—ArcGIS Pro | Documentation

Not sure if addDataFromPath actually makes the featurelayer or just adds the data from the project

... sort of retired...
0 Kudos
New Contributor

Thanks for the quick reply. When I include that command by itself the script runs but the layer does not appear on the map. I have also tried the following, but I keep getting errors. The save layer to file say the layer does not exist, so I am not sure if it is not creating a layer or if it is not saving it in the correct workspace.  As far as I can tell it is not making a layer.  

aprx ="CURRENT")
aprxMap = aprx.listMaps("Map")[0]
newlyr =, lyrpath)
save =
yieldmap =

0 Kudos