Thank you for your responses.I'm not sure I was clear in my explanation. The 'event' that drives the script is a process within arcmap. For example, a template mxd is opened and the user changes the view from data view to layout view. This action runs the script in the background creating entries into the text fields on the map layout. Effectively the key is automation, not for someone to have to click on a tool button to run the script.
import arcpy import os blankPath = r"c:\temp\blank.mxd" savePath = r"c:\temp\test.mxd" mxd = arcpy.mapping.MapDocument(blankPath) mxd.author = arcpy.GetSystemEnvironment("USERNAME") mxd.saveACopy(savePath) del mxd os.system(savePath)
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.