Select to view content in your preferred language

Model Builder and Python - ExporttoPDF

380
2
07-08-2013 08:00 AM
DustinWaller1
Deactivated User
I am running a model that also includes a python script. In the python script, I am trying to export the map to a pdf after all the changes are made from the model. The problem is that it exports it but it only exports the map without the changes. So say I am creating a buffer around a line, I have the export to pdf line at the bottom of my python script and it will export the map, but it exports it without the buffer. I have tried to saveacopy and it also only saves the map without the changes. Can anyone offer any advice to have it export the map after the changes from model builder? I am obviously doing something wrong but can't figure it out. Thanks in advance.
Tags (2)
0 Kudos
2 Replies
by Anonymous User
Not applicable
I may be wrong here, but I think you will have to explicitly create an arcpy.mapping layer for the buffer after it is created then use the arcpy.mapping.AddLayer() to add it to the TOC and then refresh the active view.  That is usually how I would do something like that.
0 Kudos
DustinWaller1
Deactivated User
I may be wrong here, but I think you will have to explicitly create an arcpy.mapping layer for the buffer after it is created then use the arcpy.mapping.AddLayer() to add it to the TOC and then refresh the active view.  That is usually how I would do something like that.


And you are correct. I appreciate your input. This is the first automated python script I have done and I have missed a few lines in the process. Thanks again.
0 Kudos