Python Script Creates MXD & PDF Outputs from Master Templates - Layer File & FT Class links break during output?

09-01-2021 10:39 AM
New Contributor III

We have an automation via python that is very useful and we are currently working on improvements to the script. The script outputs an MXD figure from a master figure template and a PDF from the MXD.

The improvement request has been to add authoritative layers to the Figures. For example: USGS Geologic Layer. So, I added the USGS Geology to the master MXD template that the script references and saved. When the script runs, it executes successfully. But the link to the USGS Geology layer is broken during the process. So, the output MXD shows the red exclamation point. Therefore the PDF exported doesn't feature the USGS Geology layer either. 

I have tested this with a shapefile, feature class, and layer file. The result is always the same. I've been doing quite a bit of reading and wondering if I need to add another function to the python script that will add the layer file to the MXD during the process. That way the link will not break.


I'm not certain if there may be something I missed. So, I wanted to kindly reach out to this community. Would anyone here have an idea of how this could be successfully executed?

0 Kudos
0 Replies