×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Batch Print ..

Batch Print ..

Batch Print ..

(OP)
Hi,

I am looking to batch print files from Solidworks 6.  I have seen the solutions for using Task Scheduler and have seen a couple of the freeware programs available but they don't seem to do what I am looking to do ...

I went to solidworks site and got their vb6 batch print example.   It appeared to allow you to change the printer depending on papersize but it doesn't seem to work.

Basically, all I need it to do is be able to specify the printer (which I can now do) and to print to 11x17 paper no matter what the size is set at in solidworks sheet ..

Here is the code that is in the example.  I have changed it to print to a specific printer for all sizes.  Now I just need the code to force it to print on 11x17 paper on that printer.   Does this make sense, or am I missing something?

Private Sub PrintListDraw(lstFileList As ListBox)
    Dim swApp                   As SldWorks.SldWorks
    Dim swModel                 As SldWorks.ModelDoc
    Dim swDrwDoc                As SldWorks.DrawingDoc
    Dim swSheet                 As SldWorks.Sheet
    Dim NumSheet                As Long
    Dim vSheetProp              As Variant
    Dim sModelPrinter           As String
    Dim nErrors                 As Long
    Dim nWarnings               As Long
    Dim i                       As Long
    Dim j                       As Long
    
    ' effectively disables VB's implicit QI
    On Error Resume Next
    
    Set swApp = CreateObject("SldWorks.Application")
    
    For j = 0 To lstFileList.ListCount - 1
        ' filter out non-drawing files
        If IsDrawingFile(lstFileList.List(j)) Then
            Set swModel = swApp.OpenDoc6(lstFileList.List(j), swDocDRAWING, _
                            swOpenDocOptions_Silent, "", nErrors, nWarnings)
            Set swDrwDoc = swModel
            
            Debug.Print "File = " + swModel.GetPathName
            
            ' blindly go to first sheet in file
            NumSheet = swDrwDoc.GetSheetCount
            For i = 0 To NumSheet - 1
                swDrwDoc.SheetPrevious
            Next i
            
            For i = 0 To NumSheet - 1
                swDrwDoc.ForceRebuild
                
                Set swSheet = swDrwDoc.GetCurrentSheet
                
                vSheetProp = swSheet.GetProperties
                
                ' FIX ME!       remove dependence on other form
                sModelPrinter = \\server1\Xerox Document Centre 440
                Debug.Print "  Sheet = " + swSheet.GetName
                Debug.Print "    PaperSize  = " + Str(vSheetProp(0))
                Debug.Print "    Printer    = " + sModelPrinter
                
                swModel.PrintOut2 i + 1, i + 1, 1, False, sModelPrinter, 0#, False, ""
                
                swDrwDoc.SheetNext
            Next i
            
            swApp.QuitDoc swModel.GetPathName
        End If
    Next j
End Sub




 

RE: Batch Print ..

Check out batchplot available here:

http://www.goengineer.com/support/downloads.aspx

-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
 

RE: Batch Print ..

Hi, dciadmin:

Set up your SW using system setting for printing.  Then your SW will always print to the same size and same printer no matter what document settings are.

Alex

 

RE: Batch Print ..

(OP)
Thanks for the replies guys ...

We are just starting to use the solidworks that we purchased a few years ago.  We haven't quite figured out how we want to do things yet but this is the basic idea:

-We are likely to have the files located in different directories so the batch program needs to be able to pick certain files from several locations.   The grand scheme would be to be able to put the assembly file into the list and have the program automatically get all of the reference files and drawings and print them.   But in the short term, I am trying to just be able to load a list of drawings into the batch print

-We want to print to 11x17 thru the batch program but would likely need to be able to change that when necessary.   The code above works good (it doesn't even visibly open solidworks when it prints) but need to be able to override or set the pagesize thru the program so we don't need to set everyone's version of solidworks up the same.

I saw a program .. I think it was called swbatchprint that offers to override solidworks settings and use whatever you want, but there was no 11x17 option.

 

RE: Batch Print ..

Hi, Dciadmin:

When you batchprint SW drawing documents, you have three choices:

1. Print all documents in a fixed size on a fixed printer;

or

2. Print all documents according to size setting saved with the documents;

or

3. You need to predetermine what size and which printer you are planning to use for each document, and code your logic (hard code or parameter) into your VB program.

If you want to control printer and paper size, you need to use ModelDoc2.PrintOut2 and PageSetup properties in SW.  You can also control printer and paper size via Windows printer object.  But you have to study on these two objects to how to use them.

Good Luck!

Alex

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources