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. HttpContext & HttpRuntime

    问题引出 HttpContext.Current.Cache .VS. HttpRuntime.Cache HttpRuntime.Cache:获取当前应用程序的Cache HttpContext.C ...

  2. Android笔记(十一) Android中的布局——网格布局

    网格布局是Android4.0新增的布局管理器,因此需要在Android4.0之后的版本才可以使用,之前的平台使用该布局的话,需要导入相应的支持库. GridLayout的作用类似于HTML中的tab ...

  3. Android笔记(四) Activity之间的数据传递

    我们之前使用Intent进行Activity之间的跳转,其实Intent还可以在启动活动的时候传递数据. Intent提供了一系列的putExtra方法以便我们把想要传递的数据暂存在Intent中,待 ...

  4. 第六篇:Python函数进阶篇

    在了解完了 Python函数基础篇之后,本篇的存在其实是为了整合知识,由于该篇的知识是否杂乱,故大家可以通过点开点连接直接进入其详细介绍,该篇主要大致的介绍一下几个知识点:  一.Python的迭代器 ...

  5. Python中的时间

    coding:utf-8 from time import strftime, localtime import time print(time.time()) time1=strftime('%Y- ...

  6. CentOS6和7启动流程

    CentOS6启动流程 https://linux.cn/article-8807-1.html BIOS 开机自检,硬件自检 MBR MBR磁盘分区是一种使用最为广泛的分区结构,它也被称为DOS分区 ...

  7. ES6 Class(类)的继承与常用方法

    一.ES6 类的定义 ES5 构造函数的写法: function Point(x, y) { this.x = x; this.y = y; } ES6 引入了 Class(类),通过class关键字 ...

  8. idea的jdk版本问题

    问题描述: 解决: 检查以上是否版本一致. 不行就再检查下面的: 如果上面的方法还是不行的话,就建议你改一下pom文件中的maven插件编译级别,可以通过搜索所有的pom.xml,1.6这个关键词,就 ...

  9. 配置ubuntu18.04

    关于Ubuntu18.04的配置: 首先在装好系统后需要配置VMware Tools,这个会在虚拟机退出全屏的时候给一个帮助链接,在帮助链接中有详细的教程. 教程链接:https://docs.vmw ...

  10. Spring Boot 项目在 IntelliJ IDEA 中配置 DevTools 实现热部署(macOS 系统)

    要配置的内容: 1.Preference -> Build, Execution, Deployment -> Complier -> Build project automatic ...