iLogic Print to Active Sheet Size

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can I print with the Active Document Sheet size using iLogic? The code below works just fine for printing to a specified sheet size (in this case 11x17). But I would like to be able to change the sheet size and have one rule that will print to the appropriate size. All the help I have found online seems to be only for printing to one size.
Dim oDrgDoc As DrawingDocument oDrgDoc = ThisApplication.ActiveDocument ' Set reference to drawing print manager' DrawingPrintManager has more options than PrintManager' as it's specific to drawing document Dim oDrgPrintMgr As DrawingPrintManager oDrgPrintMgr = oDrgDoc.PrintManager ' Set the printer name' comment this line to use default printer or assign another one oDrgPrintMgr.Printer = "\\bflprn01\BFLPRT01" 'Set the paper size , scale and orientation oDrgPrintMgr.ScaleMode = PrintScaleModeEnum.kPrintBestFitScale oDrgPrintMgr.PaperSize = PaperSizeEnum.kPaperSize11x17 oDrgPrintMgr.PrintRange = kPrintAllSheets oDrgPrintMgr.Orientation = kLandscapeOrientation oDrgPrintMgr.AllColorsAsBlack = False oDrgPrintMgr.SubmitPrint
I tried using something like this:
oPaperSize = kPaperSize & ActiveSheet.Size
...
...
oDrgPrintMgr.PaperSize = oPaperSize
But the problem seems to be that the Inventor print manager uses a string value for the sheet size, and the printer API uses an integer value so I get this error:
Error in rule: Print_Only, in document: My Standard.idw
Conversion from string "B" to type 'Integer' is not valid.
Anyone got any Ideas?