# 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. select加锁分析(Mysql)

    [原创]惊!史上最全的select加锁分析(Mysql) 前言 大家在面试中有没遇到面试官问你下面六句Sql的区别呢 select * from table where id = ? select * ...

  2. 三:MySQL系列之SQL查询

    本篇主要介绍使用SQL查询数据库的操作,包括条件查询.排序.聚合函数.分组.分页.连接查询.自关联.子查询等命令操作. 首先我们先创建一个数据库.数据表.插入字段: --------这部分在上篇以及介 ...

  3. python之匿名函数、递归与二分法

    一.匿名函数 什么是匿名函数? 顾名思义就是没有名字的函数,在我们声明一个函数时会想起个什么函数名好,这个问题我想有时候会困惑大家的吧?   def func(): #正常函数声明 pass prin ...

  4. PHP开启目录引索+fancyindex漂亮目录浏览带搜索功能

    PHP开启目录引索 一. 前言 不知为何对nginx情有独钟, 最近练习php, 为了方便写代码, 便想要开启nginx的目录索引功能, 显然不如Apache开启的方便, 几次尝试都崩了... 我这个 ...

  5. Google hacking 语法

    a b c 自动对词进行拆分匹配 拆分标准 空格 "a b c " 把a b c 当成一个整体去查 " a*b" *通配符 里面是一个或者多个 以a开头 b结尾 ...

  6. golang 时间的比较,time.Time的初始值?

    参考: https://golangcode.com/checking-if-date-has-been-set/ https://stackoverflow.com/questions/209243 ...

  7. POJ 2155 Matrix[树状数组+差分]

    原题链接:https://vjudge.net/problem/POJ-2155 题目大意 给定 n* n 矩阵A,其元素为0或1. A [i][j] 表示第i行和第j列中的数字.最初全为0. 我们有 ...

  8. P1330 封锁阳光大学[搜索+染色]

    题目来源:洛谷 题目描述 曹是一只爱刷街的老曹,暑假期间,他每天都欢快地在阳光大学的校园里刷街.河蟹看到欢快的曹,感到不爽.河蟹决定封锁阳光大学,不让曹刷街. 阳光大学的校园是一张由N个点构成的无向图 ...

  9. java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver

    SpringBoot运行报错——java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or rep ...

  10. eclipse等编辑器选中列快编辑的方法

    一.eclipse 1.首先按alt+shift+a,开启块选择模式 2.使用鼠标进行块选择 3.再次按Alt+Shift+a即可关闭块选择模式 二.EditPlus 1.菜单:编辑 -> 选择 ...