# Author:  ESRI
# Date: July 5, 2010
# Version: ArcGIS 10.0
# Purpose: This script will loop through every page layout element and apply the
# specified X and Y shifts to each element. The script is helpful for
# repositioning the elements so they are better aligned with the printer
# margins/page. This script is intended to run as a script tool and
# has four parameters:
# 1) Input map document,
# 2) X shift,
# 3) Y shift,
# 4) Output map document. import arcpy, os
import arcpy.mapping as MAP #Read parameters from dialog
mxdPath = arcpy.GetParameterAsText(0)
xShift = arcpy.GetParameterAsText(1)
yShift = arcpy.GetParameterAsText(2)
outPath = arcpy.GetParameterAsText(3) #Reference the map document
MXD = MAP.MapDocument(mxdPath) #Loop through each page layout element and shift the x and y values
for elm in MAP.ListLayoutElements(MXD):
elm.elementPositionX = elm.elementPositionX + float(xShift)
elm.elementPositionY = elm.elementPositionY + float(yShift) #Save changes to new MXD and automatically open
MXD.saveACopy(outPath)
os.startfile(outPath)

arcgis python 布局中所有元素平移的更多相关文章

  1. arcgis python 布局中所有元素信息报告

    # Author: ESRI # Date: July 5, 2010 # Version: ArcGIS 10.0 # Purpose: This script generates a report ...

  2. arcgis python 布局视图中文本查找替换

    # Author: ESRI # Date: July 5, 2010 # Version: ArcGIS 10.0 # Purpose: This script will perform a sea ...

  3. Python自动化中的元素定位(一)

    1.使用selenium中的webdriver模块对浏览器进行操作 1)from selenium import webdriver 加载模块 2)b = webdriver.Friefox() 打开 ...

  4. python selenium中等待元素出现及等待元素消失操作

    在自动化测试中,很多时候都会有等待页面某个元素出现后能进行下一步操作,或者列表中显示加载,直到加载完成后才进行下一步操作,但时间都不确定,如下图所示 幸运的是,在selenium 2后有一个模块exp ...

  5. python字典中的元素类型

    python字典默认的是string item={"browser " : 'webdriver.irefox()', 'url' : 'http://xxx.com'} 如果这样 ...

  6. Python自动化中的元素定位xpath(二)

    1.Xpath元素定位 1)ele = b.find_element_by_xpath(‘/html/body/from/input[1]’) 2)Ele = b.find_element_by_xp ...

  7. Python:将数组中的元素导出到变量中 (unpacking)

    问题 你需要将数组(list)或元组(tuple)中的元素导出到N个变量中. 解决方案 任何序列都可以通过简单的变量赋值方式将其元素分配到对应的变量中,唯一的要求就是变量的数量和结构需要和序列中的结构 ...

  8. 【381】python 获取列表中重复元素的索引值

    参考:获取python的list中含有重复值的index方法_python_脚本之家 核心思想:建立字典,遍历列表,把列表中每个元素和其索引添加到字典里面 cc = [1, 2, 3, 2, 4] f ...

  9. 递归遍历嵌套结构(多层List)中的元素 ------Python

    读Python基础教程(第二版)后看到了这么一个东西,就是利用递归遍历嵌套结构中的元素. 上代码: #encoding:UTF-8 def flatten(nested): try: #不要迭代类似字 ...

随机推荐

  1. Android应用查看本地数据库

    使用Android Studio 视图==>工具窗口 == >Device File Explorer ==> 文件在 data/data目录下,你的应用程序报名,右键save as ...

  2. 在Linux命令行中操作PDF

    pdftk 命令提供了许多处理 PDF 的命令行操作,包括合并页面.加密文件.添加水印.压缩文件,甚至还有修复 PDF. 虽然 PDF 通常被认为是相当稳定的文件,但在 Linux 和其他系统上你可以 ...

  3. chrome浏览器的跨域设置

    原文:https://www.cnblogs.com/laden666666/p/5544572.html 做前后分离的webapp开发的时候,出于一些原因往往需要将浏览器设置成支持跨域的模式,好在c ...

  4. 【转】Lombok Pojo默认初始值问题

    Lombok以注解形式来简化java代码,提高开发效率.比如我们常用的@Builder.@Data.@AllArgsConstructor.@NoArgsConstructor.@ToString等. ...

  5. Codeforces Round #499(Div2) C. Fly (二分精度)

    http://codeforces.com/contest/1011/problem/C 题目 这是一道大水题! 仅以此题解作为我这个蒟蒻掉分的见证 #include<iostream> ...

  6. 缺包与maven

    一. 缺包 1. 打开pom.xml 将依赖加入. 2. mvn clean install -DskipTests 3. scp target/lib/****.jar(刚刚的依赖的架包) 服务器地 ...

  7. Mongoose初使用总结

    连接mongoose mongoose连接数据库有两种方式 第一种: 'use strict'; const mongoose = require('mongoose'); mongoose.conn ...

  8. webpack 配置react脚手架(四):路由配置

    1. 由于 react-router 是集成了 react-router-dom 和 react-router-native的一起的,所以这里要使用的是 react-router-dom, 2. 安装 ...

  9. 搭建Git服务器环境----Git hooks代码自动部署

    引言:自己想搭一套git的服务端环境,不想用github码云等.经多方资料整合,实验总结,以下是亲测有效的方式.可用于公司日常开发 一.搭建Git环境 ① 安装 Git Linux 做为服务器端系统, ...

  10. Python Django 版本对应表