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. OpenStack kilo版(2) keystone部署

    部署在controller节点 配置数据库 MariaDB [(none)]> CREATE DATABASE keystone; Query OK, 1 row affected (0.00 ...

  2. (三)react-native开发系列之开发环境集成

    先上图,由于是虚拟机中的ios虚拟器,所以有点卡 关于react-native的开发集成,主要包括以下几个方面 1.路由及页面跳转 2.数据请求的封装 3.状态的管理 4.公共方法和全局变量的封装 5 ...

  3. 基于SpringBoot的多模块项目引入其他模块时@Autowired无法注入其他模块stereotype注解类对象的问题解决

    类似问题: 关于spring boot自动注入出现Consider defining a bean of type 'xxx' in your configuration问题解决方案 排查原因总结如下 ...

  4. SQLSEVER 同台服务器下不同表 触发器实现数据实时同步

    触发器的使用: 1.首先建立两个相同结构的表,两个表明的列的名称不同. student_01   字段  name  ;  字段 age  ; 字段  class ; student_02   字段  ...

  5. SQL SERVER-修改服务器名称

    --query servername SELECT @@SERVERNAME --alter servername sp_dropserver 'oldname' go sp_addserver 'n ...

  6. c# 方法成员

  7. cdh的web管理界面503

    503 Service Unavailable No server is available to handle this request.       重启 agent  以及 server   

  8. springboot中的小技巧

    1.Thymeleaf 在时使用Thymeleaf的时候不用设置html标签:在默认的Thymeleaf的页面中,对于.html的要求比较严格,少写或者多写标签,都会被报错,而在springboot ...

  9. Ajax 的简介与使用

    一.什么是Ajax Ajax 的全称是 Asynchronous JavaScript and XML(即异步的 JavaScript 和 XML),是一种在无需重新加载整个网页的情况下,能够更新部分 ...

  10. 备份MySQL数据库并上传到阿里云OSS存储

    1. 环境配置 要将本地文件上传到阿里云oss中, 必须使用阿里云提供的工具 ossutil, 有32位,也有64位的, Linux和Windows都有.具体可以到阿里云官网下载 官网及文档: htt ...