Printing multiple drawings
Printing multiple drawings
(OP)
I use Inventor 2011 and am looking for the easiest way to quickly print multiple part drawings. All drawings are created from the same drawing template. I might have a dozen or 2 drawings open and i would want to print them all with out having to click to each one, 'menu', 'print', 'ok'. Any suggestions?
Derek
Derek





RE: Printing multiple drawings
RE: Printing multiple drawings
I use this method alot on individual piece parts. I only have experience do this with several 1 page prints all sheet size A. not sure how it works with multiple sheets or sheets of different sizes.
you can also use this to open several parts at the same time. A word of caution, This method opens all the prints and prints them thru inventor one at a time. It can take time to do large quantities. I usually do 10 to 12 at a time cause its really a pain to interrupt.
RE: Printing multiple drawings
You cannot do it in inventor, you can do it through windows.
RE: Printing multiple drawings
Open Inventor > Press Alt+F11 > Click the + next to ApplicationProject on the left > Click the + next to Modules > Double click Module1 and paste the following:
'This code will print all files in a selected folder to your default printer on their default sized sheet
Sub BatchPrinterSub()
'Code provided by Kinetic Consulting - CAD Automation Specialists
On Error GoTo errHandle
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scripting.FileSystemObject
searchFolder = BrowseForFolder()
Set SourceFolder = FSO.GetFolder(searchFolder)
For Each FileItem In SourceFolder.Files
' display file properties
If LCase(Right(FileItem.ShortName, 4)) = ".idw" Then
PrintCount = PrintCount - 1
GoTo printThisFile
returnAfterPrint:
End If
Next FileItem
Set FileItem = Nothing
Set SourceFolder = Nothing
Set FSO = Nothing
Exit Sub
printThisFile:
Dim oOptions As NameValueMap
Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
Call oOptions.Add("DeferUpdates", True)
Dim fn As String
Dim oDoc As DrawingDocument
Dim oDrgDoc As DrawingDocument
Dim oDrgPrintMgr As DrawingPrintManager
fn = FileItem.Path
Set oDoc = ThisApplication.Documents.Open(fn, True)
If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Set oDrgDoc = ThisApplication.ActiveDocument
Set oDrgPrintMgr = oDrgDoc.PrintManager
oDrgPrintMgr.ScaleMode = kPrintBestFitScale 'kPrintCustomScale & oDrgPrintMgr.[Scale] = 1
oDrgPrintMgr.PaperSize = kPaperSizeLetter
oDrgPrintMgr.PrintRange = kPrintAllSheets
oDrgPrintMgr.AllColorsAsBlack = False
oDrgPrintMgr.SubmitPrint
End If
oDoc.Close (True)
GoTo returnAfterPrint
errHandle:
MsgBox "An error occured: " & Err.Description & ". Error Number:" & Err.Number & ". Exiting Sub..."
End Sub
Function BrowseForFolder(Optional OpenAt As Variant) As Variant
'Function purpose: To Browser for a user selected folder.
'If the "OpenAt" path is provided, open the browser at that directory
'NOTE: If invalid, it will open at the Desktop level
Dim ShellApp As Object
'Create a file browser window at the default folder
Set ShellApp = CreateObject("Shell.Application"). _
BrowseForFolder(0, "Select a folder to print all IDWs in.", 0, "C:")
'Set the folder to that selected. (On error in case cancelled)
On Error Resume Next
BrowseForFolder = ShellApp.self.Path
On Error GoTo 0
'Destroy the Shell Application
Set ShellApp = Nothing
'Check for invalid or non-entries and send to the Invalid error
'handler if found
'Valid selections can begin L: (where L is a letter) or
'\\ (as in \\servername\sharename. All others are invalid
Select Case Mid(BrowseForFolder, 2, 1)
Case Is = ":"
If Left(BrowseForFolder, 1) = ":" Then GoTo Invalid
Case Is = "\"
If Not Left(BrowseForFolder, 1) = "\" Then GoTo Invalid
Case Else
GoTo Invalid
End Select
Exit Function
Invalid:
'If it was determined that the selection was invalid, set to False
BrowseForFolder = False
End Function
'Its a little bit sloppy coding (Sorry! <:) but shuud do the trick.