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
Does wrong orientation depend on the sheet size?
Could you please check if ApprenticeDrawingPrintManager.Rotate90Degrees change orientation?
cheers,
Hi,
No the orientation is just always wrong as far as I can tell. Or what do you mean by depending on sheet size?
I will check the rotate90Degrees option and let you know.
Please check if you cannot change orientation for large formats (A0,A1) and for small size (A4).
Thanks
Hi ok I have tried printing about 5 drawings all mixed in size from A4 to A1, Scale to fit, to an A4 sheet printer. Did not work. I tried the same batch to A1 printer and that also did not work.
The only thing that works is if I set the rotate 90 property to True. Then it actually rotates and fits to the paper.
Is this a known issue with apprentice?
Pieter
Hi Vladimir,
I have implemented the rotate 90 option and it seems to work fine.
There seems to be another issue using apprentice for printing. None of the images on the drawings actually prints. All the views and everything is perfect but it leaves off the images. So our company logo for instance does not print at all.
Is there a workaround for this?
Hi
It seems to do it with any drawing with an image in the titleblock.
See attached zip file.
Thanks
Can't find what you're looking for? Ask the community or share your knowledge.