Hey Ted,I couldnt make out your code in the video, but I was able to get this basic script to work. Can you let me know if it works for you?import arcpy mxd = arcpy.mapping.MapDocument(r"C:\temp\forum\table.mxd") elm = arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT")[0] elm.elementPositionY = 1 mxd.save() del mxdI created a table layout element that had a buch of space under it, resized the layout element to match the bottom of the table, then ran the code.
import arcpy mxd = arcpy.mapping.MapDocument(r"C:\temp\forum\table.mxd") elm = arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT")[0] elm.elementPositionY = 1 mxd.save() del mxd
import arcpy import os import datetime from arcpy import env as ENV from arcpy import mapping as MAP ENV.overwriteOutput = True ENV.workspace = r"C:\1GIS\Test" wrksp = ENV.workspace mxd = MAP.MapDocument (r"C:\1GIS\Test\MappingModule.mxd") for elm in MAP.ListLayoutElements (mxd): print elm.name if elm.name == "ReportMap": elm.elementHeight = 2 elm.elelmentWidth = 2 elm.elementPositionX = 6.5 elm.elementPositionY = .5 if elm.name == "TableMap": elm.elementHeight = 2 elm.elelmentWidth = 2 elm.elementPositionX = .5 elm.elementPositionY = .5 mxd.save () del mxd
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.