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 idw using Apprentice, no shading in output

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
gavbath
643 Views, 7 Replies

Printing idw using Apprentice, no shading in output

For some reason, since migrating to Inventor and Vault 2015, when printing .idws from a custom tool that we wrote, the output has no shading on the views.

 

So in Inventor 2014, you would select a file and hit print, the tool downloads it from vault and prints it using Inventor apprentice.

After moving to 2015, the drawings still print correctly (with shading) in Inventor and Vault, but they come out with no shading when printing using Apprentice Server.

 

Anyone got any idea why, or whether there is a setting to change this somewhere?

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

7 REPLIES 7
Message 2 of 8
adam.nagy
in reply to: gavbath

Hi Gavin,

 

Hope the trip home was alright. 🙂

 

Would you mind pasting the code that does the actual printing?

Also, I assume you experience the same behaviour with all the drawings... ?

Do you have SP1 installed?

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 8
gavbath
in reply to: gavbath

Hi Adam. Sorry for the slow response. I'll post the code tomorrow.

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

Message 4 of 8
gavbath
in reply to: adam.nagy

Hi Adam, here is the code I'm using for printing:

 

private string PrintFile(string filepath, int filesize)
        {
            Inventor.ApprenticeServerComponent oAppServ = new Inventor.ApprenticeServerComponent();

            WaitForFile(filepath, filesize);
            string retval = string.Empty;
            int loopCount = 0;
            do
            {
                loopCount++;
                //Pause for 1/2 second
                System.Threading.Thread.Sleep(500);

                try
                {
                    Inv.ApprenticeServerDrawingDocument oAppDoc = (Inv.ApprenticeServerDrawingDocument)oAppServ.Open(filepath);

                    Inventor.ApprenticeDrawingPrintManager PrintMgr = null;

                    //Dim lp As Long

                    string idwname = System.IO.Path.GetFileName(filepath);

                    PrintMgr = (Inv.ApprenticeDrawingPrintManager)oAppDoc.PrintManager;

                    string printername = this.cboPrinters.SelectedItem.ToString().Trim();

                    PrintMgr.Printer = printername;

                    //Set the paper size , scale and orientation
                    PrintMgr.ScaleMode = Inv.PrintScaleModeEnum.kPrintBestFitScale;

                    switch (cboPageSize.Text)
                    {
                        case "A4":
                            PrintMgr.PaperSize = Inv.PaperSizeEnum.kPaperSizeA4;
                            break;
                        case "A3":
                            PrintMgr.PaperSize = Inv.PaperSizeEnum.kPaperSizeA3;
                            break;
                        case "A2":
                            PrintMgr.PaperSize = Inv.PaperSizeEnum.kPaperSizeA2;
                            break;
                        case "A1":
                            PrintMgr.PaperSize = Inv.PaperSizeEnum.kPaperSizeA1;
                            break;
                        case "A0":
                            PrintMgr.PaperSize = Inv.PaperSizeEnum.kPaperSizeA0;
                            break;
                        default:
                            PrintMgr.PaperSize = Inv.PaperSizeEnum.kPaperSizeDefault;
                            break;
                    }

                    switch (optPortrait.Checked)
                    {
                        case true:
                            PrintMgr.Orientation = Inv.PrintOrientationEnum.kPortraitOrientation;
                            break;
                        case false:
                            PrintMgr.Orientation = Inv.PrintOrientationEnum.kLandscapeOrientation;
                            break;
                        default:
                            PrintMgr.Orientation = Inv.PrintOrientationEnum.kDefaultOrientation;
                            break;
                    }

                    PrintMgr.PrintRange = Inventor.PrintRangeEnum.kPrintAllSheets;

                    //Set range for print to sheet no
                    PrintMgr.SubmitPrint();
                    this.StatusBar1.Text = "Print Submitted for " + idwname;
                    PrintMgr = null;
                    oAppDoc = null;
                    oAppServ = null;
                    retval = string.Empty;
                    //Set loop count so that do will end
                    loopCount = 3;
                }
                catch (Exception ex)
                {
                    retval += "Error printing Try " + loopCount + " File " + SysIO.Path.GetFileName(filepath) + "\n";
                    this.StatusBar1.Text = retval;
                    this.StatusBar1.Text = ex.ToString();

                }
                
            } while (loopCount <3);
 
            return retval;

        }

 

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

Message 5 of 8
adam.nagy
in reply to: gavbath

Hi Gavin,

 

This took quite a bit of time :-s having completely forgotten about the Apprentice 2015 issue during the holiday and that it could affect printing as well - even though Wayne did mention it in this article: http://adndevblog.typepad.com/manufacturing/2014/09/inventorviewctrlocx-2015-not-displaying-inventor...

 

Here is the solution:

http://adndevblog.typepad.com/manufacturing/2015/01/print-shaded-view-from-apprentice.html

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 6 of 8
gavbath
in reply to: adam.nagy

Aha! Thanks! That's what I needed. I'll do this now.

Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube


   

Message 7 of 8
andrewwhiteinc
in reply to: adam.nagy

I know this thread is old, but I am having this issue and the posted solution does not appear to be working. I have Inventor 2016 and Inventor 2014 installed on my system. Would it be using the Apprentice Svr from 2014?

P. Andrew White, P.Eng
Manufacturing Engineering Manager
Silent-Aire Manufacturing
Message 8 of 8
adam.nagy
in reply to: andrewwhiteinc

It depends on which Inventor version was run last.



Adam Nagy
Autodesk Platform Services

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

Post to forums  

Autodesk Design & Make Report