Created
November 18, 2019 20:19
-
-
Save gpprojekt-marcin/70380fe99e1ae3aa778959b0f2a006a6 to your computer and use it in GitHub Desktop.
Sync project extents with base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arcpy.env.workspace = "." | |
current_mxd = arcpy.mapping.MapDocument("CURRENT") | |
current_dfs = arcpy.mapping.ListDataFrames(current_mxd) | |
project_filename = current_mxd.filePath.split('\\')[-1] | |
project_name = project_filename[:-4].split('_')[0] | |
project_scale = project_filename[:-4].split('_')[-1] | |
plan_filename = "{}_RysunekPlanu_{}.mxd".format(project_name, project_scale) | |
plan_mxd = arcpy.mapping.MapDocument(plan_filename) | |
source_dfs = arcpy.mapping.ListDataFrames(plan_mxd) | |
for index in range(len(source_dfs)): | |
current_dfs[index].extent = source_dfs[index].extent | |
current_mxd.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment