Change Application Options Color Scheme, And Visual Style for clear printing.

Change Application Options Color Scheme, And Visual Style for clear printing.

C_Haines_ENG
Collaborator Collaborator
533 Views
2 Replies
Message 1 of 3

Change Application Options Color Scheme, And Visual Style for clear printing.

C_Haines_ENG
Collaborator
Collaborator

Id like to be able to change the color sceme to have a white background, and change the visual style to "Wireframe with hidden edges", after this it would print and change everything back.

 

Is this possible? It would be inside part / assembly files.

0 Likes
Accepted solutions (1)
534 Views
2 Replies
Replies (2)
Message 2 of 3

earl_cody
Contributor
Contributor
Accepted solution

@C_Haines_ENG - Hi. Try this ilogic.

iLogicVb.UpdateWhenDone = True

'get active Inventor application
Dim inv As Inventor.Application = ThisApplication

'create handles to original settings (to set back to at end)
Dim colorSchemeOriginal As Inventor.ColorScheme = inv.ActiveColorScheme
Dim colorSchemeBackgroundTypeOriginal As Inventor.BackgroundTypeEnum = inv.ColorSchemes.BackgroundType
Dim viewDisplayModeOriginal As Inventor.DisplayModeEnum = inv.ActiveView.DisplayMode

'change to white background with wireframe with hidden edges
Call inv.ColorSchemes.Item("Presentation").Activate()
inv.ColorSchemes.BackgroundType = Inventor.BackgroundTypeEnum.kOneColorBackgroundType
inv.ActiveView.DisplayMode = Inventor.DisplayModeEnum.kWireframeWithHiddenEdgesRendering

'update the active view
Call inv.ActiveView.Update()

'get handle of active document
Dim doc As Inventor.Document = inv.ActiveDocument

'get handle for print manager
Dim printMGR As Inventor.PrintManager = doc.PrintManager

'set settings for print manager
printMGR.Printer = "Microsoft Print to PDF"
'commented out the following settings for user to decide
'printMGR.PaperSize = Inventor.PaperSizeEnum.kPaperSizeLetter
'printMGR.Orientation = Inventor.PageOrientationTypeEnum.kLandscapePageOrientation
'printMGR.ColorMode = Inventor.PrintColorModeEnum.kPrintGrayScale

'create string filepath of exported PDF file
Dim fpPDF As String = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) & "\" & doc.DisplayName.Split(".")(0) & ".pdf"

'print
Call printMGR.PrintToFile(fpPDF)

'change the environment back to original settings
Call colorSchemeOriginal.Activate()
inv.ColorSchemes.BackgroundType = colorSchemeBackgroundTypeOriginal
inv.ActiveView.DisplayMode = viewDisplayModeOriginal

'update active view
Call inv.ActiveView.Update()

MessageBox.Show("Done")

 

0 Likes
Message 3 of 3

C_Haines_ENG
Collaborator
Collaborator

Absolutely amazing! Thank you!

0 Likes