几何尺寸与公差论坛

 找回密码
 注册
查看: 716|回复: 0

【转帖】printout2 problem

[复制链接]
发表于 2009-4-12 19:16:56 | 显示全部楼层 |阅读模式
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)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 22:32 , Processed in 0.035764 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表