class ToolValidator:
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog.""" def __init__(self):
"""Setup the Geoprocessor and the list of tool parameters."""
import arcgisscripting as ARC
self.GP = ARC.create(9.3)
self.params = self.GP.getparameterinfo() def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
import arcpy.mapping as MAP
printerList = MAP.ListPrinterNames()
if not self.params[1].Altered:
self.params[1].Filter.List = printerList return def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parmater
has been changed."""
return def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
===========================================
import arcpy, string
import arcpy.mapping as MAP #Read input parameters from script tool
MXDList = string.split(arcpy.GetParameterAsText(0), ";")
printer = arcpy.GetParameterAsText(1) #Loop through each MXD and print
for MXDPath in MXDList:
MXD = MAP.MapDocument(MXDPath)
MAP.PrintMap(MXD, printer) #Remove variable reference to file
del MXD

 

arcgis python 获得打印机的更多相关文章

  1. arcgis python arcpy add data script添加数据脚本

    arcgis python arcpy add data script添加数据脚本mxd = arcpy.mapping.MapDocument("CURRENT")... df ...

  2. ArcGIS Python编程案例-电子资料链接

    ArcGIS Python编程案例(1)-Python语言基础 https://www.jianshu.com/p/dd90816d019b ArcGIS Python编程案例(2)-使用ArcPy编 ...

  3. arcgis python脚本工具实例教程—栅格范围提取至多边形要素类

    arcgis python脚本工具实例教程-栅格范围提取至多边形要素类 商务合作,科技咨询,版权转让:向日葵,135-4855_4328,xiexiaokui#qq.com 功能:提取栅格数据的范围, ...

  4. ArcGIS Python人门到精通目录基于ArcGIS10.2,100以上案例15章42个视频806分钟,51GIS网站上线

    ArcGIS Python人门到精通目录 闫老师 QQ:276529800 微信13108507190 1.  ArcGIS Python基础 1.1  ArcGIS为什么学习Python 1.2 A ...

  5. arcpy arcgis python实例教程--原点夹角距离定义线(坐标正算)

    arcpy arcgis python实例教程--原点夹角距离定义线(坐标正算) 商务合作,科技咨询,版权转让:向日葵,135-4855__4328,xiexiaokui#qq.com 此地理处理工具 ...

  6. arcgis python获得字段唯一值

    arcgis python获得字段唯一值 # Import native arcgisscripting moduleimport arcgisscripting, sys# Create the g ...

  7. ArcGis Python常用脚本

    ArcGis Python脚本——ArcGIS 中使用的 Python 是什么版本 ArcGis Python脚本——批量添加字段 ArcGis Python脚本——批量删除字段 ArcGis Pyt ...

  8. 【ArcGIS遇上Python】ArcGIS Python批处理入门到精通实用教程目录

    目录 1. 专栏简介 2. 专栏地址 3. 专栏目录 1. 专栏简介 Python语言是目前很火热的语言,极大的促进了人工智能发展.你知道在ArcGIS中也会有python的身影吗?事实上,在ArcG ...

  9. ArcGis Python脚本——遍历输出面或折线要素的折点坐标

    有示例要素类如下 经过下面代码处理 #遍历输出面或折线要素的折点坐标 #infc:输入要素类 # code source: https://www.cnblogs.com/yzhyingcool/# ...

随机推荐

  1. coco creator编辑动画坑之拖图片

    如图所示,批量选中多张图片之后,拖到右下角的框中,发现有时候可以有时候不行.这个我觉得是个软件的bug 后来经过测试发现只有在粉红色圈的高度才可以正确放入图片,否则都放不了.

  2. Shell 脚本操作数据库实战

    安装mariadb 数据库  (默认没有密码,直接mysql即可进入数据库管理控制台) yum install mariadb mariadb-server mariadb-libs -y syste ...

  3. Hive数据库操作

    Hive数据结构 除了基本数据类型(与java类似),hive支持三种集合类型 Hive集合类型数据 array.map.structs hive (default)> create table ...

  4. layui 后台分页

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  5. JAVA笔记整理(九),JAVA中的集合

    在工作中,我们经常需要将多个对象集中存放,可以使用数组,但是数组的长度一旦固定之后是不可变的,为了保存数量确定的数据,我们可以使用JAVA中的集合. 在我看来,JAVA中的集合可以看作是一个特殊的数据 ...

  6. 1.利用BeanMap进行对象与Map的相互转换

    javabean与map的转换有很多种方式,比如: 1.通过ObjectMapper先将bean转换为json,再将json转换为map,但是这种方法比较绕,且效率很低,经测试,循环转换10000个b ...

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

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

  8. python练习题(三)

    题目: 一.二选一 1.每个区生成1个符合身份证规则的身份证号码 2.随机生成10个符合身份证规则的身份证号码 二.要求: 1.身份证属于南京市 2.出生日期为1980-1-1 至 2019-8-1的 ...

  9. 用CSS 实现 非浮动元素的 水平居中/垂直居中/水平垂直居中

    一.水平居中 (1)行内元素解决方案 只需要把行内元素包裹在一个属性display为block的父层元素中,并且把父层元素添加如下属性即可:   .parent { text-align:center ...

  10. Java原子类--AtomicLongFieldUpdater

    转载请注明出处:http://www.cnblogs.com/skywang12345/p/3514623.html AtomicLongFieldUpdater介绍和函数列表 AtomicLongF ...