Printing using Apprentice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
Apprentice has been a graet module for many things I do and its just so effecient... I love it!
Having said that, I have a bit of an issue with printing Inventor drawings using Apprentice. Apprentice seems to ignore print orientation settings. Printing the normal way using Inventor API works great and the orientaion setting works 100%. Please see code below:
This is using Apprentice
Dim oASC As New Inventor.ApprenticeServerComponent Dim oASCDoc As Inventor.ApprenticeServerDrawingDocument Dim oApprServPrintMgr As Inventor.ApprenticeDrawingPrintManager oASCDoc = oASC.Open("Filename") oApprServPrintMgr = oASCDoc.PrintManager Select Case frmOptions.ComboOrientation.SelectedIndex Case 0 oApprServPrintMgr.Orientation = PrintOrientationEnum.kDefaultOrientation Case 1 oApprServPrintMgr.Orientation = PrintOrientationEnum.kLandscapeOrientation Case 2 oApprServPrintMgr.Orientation = PrintOrientationEnum.kPortraitOrientation End Select oApprServPrintMgr.ColorMode = PrintColorModeEnum.kPrintGrayScale oApprServPrintMgr.SubmitPrint() oASCDoc.Close()
This is using Inventor API
Dim oDoc As Inventor.DrawingDocument
Dim oDocOpenOptions As NameValueMap
oDocOpenOptions = oApp.TransientObjects.CreateNameValueMap
oDocOpenOptions.Add("SkipAllUnresolvedFiles", True)
oDocOpenOptions.Add("DeferUpdates", True)
Dim oApprDrgPrintMgr As Inventor.DrawingPrintManager
oDoc = oApp.Documents.OpenWithOptions(Filename, oDocOpenOptions, True)
oApprDrgPrintMgr = oDoc.PrintManager
Select Case frmOptions.ComboOrientation.SelectedIndex
Case 0
oApprDrgPrintMgr.Orientation = PrintOrientationEnum.kDefaultOrientation
Case 1
oApprDrgPrintMgr.Orientation = PrintOrientationEnum.kLandscapeOrientation
Case 2
oApprDrgPrintMgr.Orientation = PrintOrientationEnum.kPortraitOrientation
End Select
oApprDrgPrintMgr.ColorMode = PrintColorModeEnum.kPrintGrayScale
oApprDrgPrintMgr.SubmitPrint()
oDoc.Close(True)
Ok so using code as in above, both do print but the Apprentice method does not exept the Orientation setting and no matter what setting I use it always print the drawing rotated accross the sheet. Using Inventor API works 100%
Obviously I would like to start using Apprentice as its 100 times faster so any advice here would be great guys.
Thanks
Pieter