arcgis python批量打印复印_ArcGIS python获得打印机

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()

ifnotself.params[1].Altered:

self.params[1].Filter.List = printerList

returndef updateParameters(self):

"""Modify the values and properties of parameters before internal

validation is performed.  This method is called whenever a parmater

has been changed."""returndef updateMessages(self):

"""Modify the messages created by internal validation for each tool

parameter.  This method is called after internal validation."""return

===========================================

import arcpy, stringimport arcpy.mapping as MAP#Read input parameters from script toolMXDList = string.split(arcpy.GetParameterAsText(0),";")

printer = arcpy.GetParameterAsText(1)#Loop through each MXD and printforMXDPathin MXDList:

MXD = MAP.MapDocument(MXDPath)

MAP.PrintMap(MXD, printer)#Remove variable reference to filedelMXD

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值