So I found the code again and thought that I would share it:
SyntaxEditor Code Snippet
' This is print all the associated idws of an assembly to PDF. This is similar to the "Print all Ref idw" macro functionality, but' it is now converted into a iLogic rule. This assumes that the idw is teh same file name as the part or the assembly.'There are a few changes to the orginal Macro:' 1. Now have an option to print in color or B/W.' 2. The ilogic code also prints the top level assembly.' ----------------------------------------------------------------Kirk Arthur 8/30/2016
'check that the active document is an assembly file
If ThisApplication.ActiveDocument.DocumentType <> kAssemblyDocumentObject Then
MessageBox.Show("Please run this rule from the assembly file.", "iLogic")
Exit Sub
End If
'define the active document as an assembly file
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)
'get user input
RUsure = MessageBox.Show ( _
"This will create a PDF file for all of the assembly components that have" _
& vbLf & "drawings files. This rule expects that the drawing file shares the same" _
& vbLf & " name and location as the component." _
& vbLf & "" _
& vbLf & "Make sure the file extensions are set to Visible in Windows Explorer." _
& vbLf & "" _
& vbLf & "This could take a while. Are you sure you want to do this?" _
& vbLf & "" _
& vbLf & "", "iLogic - Batch Output PDFs ",MessageBoxButtons.YesNo)
If RUsure = vbNo Then
Return
Else
End If
'- - - - - - - - - - - - -PDF setup - - - - - - - - - - - -
If ThisApplication.ActiveDocument.DocumentType <> kAssemblyDocumentObject Then
MsgBox ("This is NOT an assembly document!")
Exit Sub
End If
Dim oPrintMgr As PrintManager
oPrintMgr = ThisApplication.ActiveDocument.PrintManager
If MsgBox("Using Printer " & oPrintMgr.Printer & ", Best Fit, 11x17 paper, Landscape Mode." _
& vbLf & " " _
& vbLf & " Do you want to continue?" _ ,vbYesNo + vbQuestion,"System Printer Settings ") = vbNo Then
Exit Sub
End If
Dim oDrgPrintMgr As DrawingPrintManager
'MsgBox ("Using Printer " & oPrintMgr.Printer & ", Best Fit, 11x17 paper, Landscape Mode.")
dirPath = Left(oAsmDoc.FullFileName, Len(oAsmDoc.FullFileName) - Len(oAsmDoc.DisplayName))
' ----Determine if the prints should be in color or B/W ------
oColorAsBlack="False"
RUsure = MessageBox.Show ( "Do you want to print this in COLOR?"& vbLf & "", "Color or B/W Prints",MessageBoxButtons.YesNo)
If RUsure = vbNo Then
oColorAsBlack="True"
'Return
Else
End If
Dim oRefDocs As DocumentsEnumerator
oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document
numFiles = 0
''End If
'get PDF target folder path
oFolder = oPath & "\" & oAsmName & " PDF Files"
'Check for the PDF folder and create it if it does not exist'If Not System.IO.Directory.Exists(oFolder) Then
'System.IO.Directory.CreateDirectory(oFolder)'End If
'- - - - - - - - - - - - -Component Drawings - - - - - - - - - - - -'look at the files referenced by the assembly
For Each oRefDoc In oRefDocs
idwPathName = Left(oRefDoc.FullDocumentName, Len(oRefDoc.FullDocumentName) - 3) & "idw"
If (System.IO.File.Exists(idwPathName)) Then
numFiles = numFiles + 1
'If numFiles = 10 Then Exit Sub
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.Documents.Open(idwPathName, True)
oDrawDoc.Activate
oDrawDoc = ThisApplication.ActiveDocument
oDrgPrintMgr = oDrawDoc.PrintManager
oDrgPrintMgr.AllColorsAsBlack = oColorAsBlack
oDrgPrintMgr.ScaleMode = kPrintBestFitScale
oPrintMgr = ThisApplication.ActiveDocument.PrintManager
' Printer setup, default printer
'oPrintMgr.ColorMode = kPrintDefaultColorMode ' Set to default. Uses printer settings
oPrintMgr.PrintRange = kPrintAllSheets 'Prints all sheets in the idw.
oPrintMgr.NumberOfCopies = 1 ' Set to print one copies.
oPrintMgr.Orientation = kLandscapeOrientation ' Set to print using landscape orientation.
oPrintMgr.PaperSize = kPaperSizeTabloid 'Set the paper size.
oPrintMgr.SubmitPrint ' Submit the print.
oDrawDoc.Close (True)
End If
Next
'MsgBox ("There are " & numFiles & " sent to printer.")
'- - - - - - - - - - - - -
'- - - - - - - - - - - - -Top Level Drawing - - - - - - - - - - - -
oAsmDrawing = ThisDoc.ChangeExtension(".idw")
If (System.IO.File.Exists(oAsmDrawing)) Then
oAsmDrawingDoc = ThisApplication.Documents.Open(oAsmDrawing, True)
oAsmDrawingName = Left(oAsmDrawingDoc.DisplayName, Len(oAsmDrawingDoc.DisplayName) -3)
'write out the PDF for the Top Level Assembly Drawing file
oAsmDrawDoc = ThisApplication.Documents.Open(oAsmDrawing, True)
oAsmDrawDoc.Activate
oDrgPrintMgr = oAsmDrawDoc.PrintManager
oDrgPrintMgr.AllColorsAsBlack = oColorAsBlack
oDrgPrintMgr.ScaleMode = kPrintBestFitScale
oPrintMgr = ThisApplication.ActiveDocument.PrintManager
' Printer setup, default printer
'oPrintMgr.ColorMode = kPrintDefaultColorMode ' Set to default. Uses printer settings
oPrintMgr.PrintRange = kPrintAllSheets 'Prints all sheets in the idw.
oPrintMgr.NumberOfCopies = 1 ' Set to print one copies.
oPrintMgr.Orientation = kLandscapeOrientation ' Set to print using landscape orientation.
oPrintMgr.PaperSize = kPaperSizeTabloid 'Set the paper size.
oPrintMgr.SubmitPrint ' Submit the print.
oAsmDrawDoc.Close (True)
numFiles = numFiles + 1
Else
MessageBox.Show (" No IDW of the Top level file found!" _
& vbLf & " " _
& vbLf & "There were " & numFiles & " files sent to the printer."," Job Complete ")
Return
End If
'- - - - - - - - - - - - -
MessageBox.Show ("There were " & numFiles & " files sent to the printer."," Job Complete ")
'MessageBox.Show("New Files Created in: " & vbLf & idwpathname, "iLogic")'open the folder where the new ffiles are saved'Shell("explorer.exe " & oFolder,vbNormalFocus)