Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Printing using Apprentice

10 REPLIES 10
Reply
Message 1 of 11
Raider_71
362 Views, 10 Replies

Printing using Apprentice

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

 

10 REPLIES 10
Message 2 of 11
Raider_71
in reply to: Raider_71

Hi guys,

Has no one experienced this before?

Thanks
Message 3 of 11

Does wrong orientation depend on the sheet size?

Could you please check if ApprenticeDrawingPrintManager.Rotate90Degrees change orientation?

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 4 of 11

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.

Message 5 of 11

Please check if you cannot change orientation for large formats (A0,A1) and for small size  (A4).

Thanks


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 6 of 11

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

 

Message 7 of 11
Raider_71
in reply to: Raider_71

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?

Message 8 of 11
xiaodong_liang
in reply to: Raider_71

Hi,

could you provide a demo drawing. We can test what the problem is with the workflow.
Message 9 of 11
Raider_71
in reply to: xiaodong_liang

Hi

 

It seems to do it with any drawing with an image in the titleblock.

 

See attached zip file.

 

Thanks

Message 10 of 11

This is a known limitation with embedded images in Apprentice Smiley Sad

It was discussed here


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 11 of 11

Ok thanks for the reply. This is a majour limitation and renders the printing finction pretty useless correct?
Is there a timeline for this to be fixed?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report