查看单个帖子
旧 2009-04-12, 07:16 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】printout2 problem

printout2 problem
i am having a problem using printout2. when i run the macro it prints all sheets of the drawing. i have set the pagearray to 0, but i still get all pages plotting. what am i doing wrong? see code
sub main()
dim printer as string
dim pagearray(0) as long
pagearray(0) = 0
set swapp = application.sldworks
set model = swapp.activedoc
set swdraw = model
set swsheet = swdraw.getcurrentsheet
call saveasjpg
debug.print model.printer
set ps = model.pagesetup
size = swsheet.getsize(width, height)
width = round(width * 39.36996, 2)
height = round(height * 39.36996, 2)
if width = 17 and height = 11 then
model.printer = "engineering laserjet"
printer = "engineering laserjet"
ps.printerpapersize = bsize
ps.drawingcolor = 3
ps.orientation = 2
end if
model.extension.printout2 pagearray, 1, true, printer, ""
end sub
thanks
bryan
you have to specify the array in doubles, so from-to, from-to. you need to set it to 0, 0. not just 0 (or possibly 1, 1 not sure if its zero or one-based index)
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)