几何尺寸与公差论坛

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

【转帖】batch printing from lis

[复制链接]
发表于 2009-4-13 09:14:21 | 显示全部楼层 |阅读模式
batch printing from list
i downloaded this neat batch printing example from the sw api help website. i gave it a list of 30 drawings and it printed them out in less than 2 mins! it didn't need to open solidworks every time to print.
it also did "scale to fit" for every drawing so every drawing printed out perfect.
i tried to run the program again and it won't work. i deleted it and reinstalled it and it doesn't work ughghg. i have 60 more to do. so i tried the task scheduler. that takes 10x as long as i can't just give that a "list" (they are all in different folders) and it has to open solidworks every time and it doesn't do scale to fit so the print is useless.
we have no pdm. what do you guys use for your batch printing? the macro that was great and fast was here
i don't have need of a batch printing utility, but maybe these will help.
thanks but
-swcp3 - doesn't work. i open the dll and there is no ad in enabled. apparently this only works on old sw versions and not 2007
- ecocom - free trial doesn't cut it
- batchexpress - crashes out and locks up my computer

wow ... it's just not your day is it.  

^ tell me about it haha.
i just had to go in and print them one by one. just finished. its almost 4 pm. what a joke.
i wish that first batch program i posted would work again! maybe its because i have an x64 computer.
anyways. if someone comes up with a fix for it, wow what a tool it could be.  
try pac4swx there's a pretty comprehensive 30 day trial for you.  it worked on 2007 when i had the demo
here is some code i wrote some time ago. just copy and paste into excel. you will need to turn on hte following references. sldworks 2007 type library, solidworks 2007 commands type library, solidworks 2007 constant type library.
your list of files should be located on sheet1 and it should be the full path.
if you get errors after you paste it make sure to correct rows from the way the text was wrapped.
sub print_drawing()
dim swapp               as sldworks.sldworks
dim dwgdoc              as sldworks.modeldoc2
dim strdrawing          as string
dim lerrors             as long
dim lwarnings           as long
' this section sorts and counts the rows for the number of item to search for
    range("a1:c200").sort key1:=range("a1"), order1:=xlascending, header:= _
        xlguess, ordercustom:=1,  matchcase:=false,orientation:=xltoptobottom, _
        dataoption1:=xlsortnormal
    dim totalrows as string
    totalrows = range("a65536").end(xlup).row
    worksheets("sheet1").cells(2, 4) = totalrows
   
for counter = 1 to range("d2").value
   
    set swapp = createobject("sldworks.application")
    swapp.visible = false 'if you want to see the action change to true
    strdrawing = worksheets("sheet1").cells(counter, 1).value
    set dwgdoc = swapp.opendoc6(strdrawing, swdocdrawing, swopendocoptions_viewonly, "", lerrors, lwarnings)
    dwgdoc.extension.printout2 vpagearray, copies, collate, "", ""
    newhour = hour(now())                                       'speed up or slow down here
    newminute = minute(now())                                   '
    newsecond = second(now()) + 1                               '
    waittime = timeserial(newhour, newminute, newsecond)        '
    application.wait waittime
    swapp.quitdoc strdrawing
   
next counter
end sub

i am using swbatchprint 1.5. no complains so far. it is free. search for it on the net. i think i dowloaded it from fcsuper's website.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 02:45 , Processed in 0.038041 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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