Hello,
I am working on an automated map script that will allow me to import a Shapefile, assign it a pre-defined symbology, zoom to a layer and export a map. I am having one issue when I bring in my input file. I am using the addDataFromPath() function to bring in my data, and it indeed brings it in fine. However, the file shows up in my table of contents and legend with the text "_Layer2", "_Layer3" etc, after the name of the file I bring it.
I would like to simply rename what is in my legend and TOC to something I want such as "Project Area" or "AOI", etc.
Does anyone here have the experience with arcpy.mp to get that to work?
Thank you for your time!
Solved! Go to Solution.
Thank's for the clarification! So you are basically .net is in the driver's seat pushing the layer down to python instead of python pulling it in. Most of the tools I developed in .net using ArcObjects relied on the selected layer as an input, but developing .net for Pro seems to take at least twice as much effort so I started doing python notebooks and was looking for a way to keep the same workflow and avoid hardcoding or building python toolboxes. I'll keep this workaround in mind, but If I go to the trouble of creating an addin, I'd probably just keep going and have it do the whole task.
Yes! 100% this works. It's exactly what I was hoping for. Thank you!
That did it! Thank you VERY much.
Thank you. That looks promising. I'll try it and will be happy to give your credit if it works.