- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been trying to get Inventor to output to a PLT (PRN) file in the orientation that works best with out printer - A Xerox 6279. This is the code I've been using, but try as I might, I can't seem to get the options of the drawingPrintManager object to do what I want. This is the code I've been using, I took out the references to other drawing sizes since I'm hoping to get this to work with a B size first, then I can adapt it to other sizes.
Public Sub PlotAllSheets()
Dim OInvdrawdoc As DrawingDocument
Dim oDrawDoc As DrawingDocument
Dim oSheet As Sheet
Dim oDrawPrintMgr As DrawingPrintManager
Dim sFullFileName As String
Dim f2Partno As String
Set OInvdrawdoc = ThisApplication.ActiveDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Set oSheet = oDrawDoc.ActiveSheet
If ThisApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
Set oDrawPrintMgr = OInvdrawdoc.PrintManager
oDrawPrintMgr.ScaleMode = PrintScaleModeEnum.kPrintBestFitScale
oDrawPrintMgr.AllColorsAsBlack = True
Select Case oSheet.Size
Case 9988:
oDrawPrintMgr.Printer = "Xerox 6279 Print to Plot"
oDrawPrintMgr.PaperSize = kPaperSize11x17
' If I set rotate90Degress = true, it DOES come out
' Horizontal, but it's upside down!
'oDrawPrintMgr.Rotate90Degrees = True
oDrawPrintMgr.Rotate90Degrees = False
oDrawPrintMgr.PaperHeight = 11
oDrawPrintMgr.PaperWidth = 17
' No Matter WHICH of these I choose, it has no effect
' on what the PLT comes out as - It's always Portrait.
'oDrawPrintMgr.Orientation = kPortraitOrientation
oDrawPrintMgr.Orientation = kLandscapeOrientation
'oDrawPrintMgr.Orientation = kDefaultOrientation
End Select
End If
' Save FileName
sFullFileName = "H:\dp\templot\" & Left(OInvdrawdoc.DisplayName, Len(OInvdrawdoc.DisplayName) - 4) & ".PLT"
Debug.Print sFullPDFName
' Export to a PLT..
oDrawPrintMgr.PrintToFile (sFullFileName)
End Sub
This is the output I get from modifying these options:
Solved! Go to Solution.