iLogic Print Code - How to set paper size?

iLogic Print Code - How to set paper size?

Jason.Rugg
Collaborator Collaborator
2,117 Views
7 Replies
Message 1 of 8

iLogic Print Code - How to set paper size?

Jason.Rugg
Collaborator
Collaborator

I have the following iLogic code for printing, it works great other than I can not get it to print Ledger/11x17. No matter how I try setting the paper size it refuses to print anything except Letter/8.5x11. Anyone have any other suggestions on how to set paper size?

 

'Print Setup
'[
Dim oDrgDoc As DrawingDocument
oDrgDoc = ThisApplication.ActiveDocument

' Set reference to drawing print manager' DrawingPrintManager has more options than PrintManager' as it's specific to drawing document
Dim oDrgPrintMgr As DrawingPrintManager
oDrgPrintMgr = oDrgDoc.PrintManager
' Set the printer name' comment this line to use default printer or assign another one
'oDrgPrintMgr.Printer = "\\kcidc2012\EngineeringSharp_Ledger"
'oDrgPrintMgr.Printer = "EngineeringSharp_Ledger"
oDrgPrintMgr.Printer = "\\kcidc2012.kciinc.net\EngineeringSharp_Ledger"

'Set the paper size , scale and orientation
oDrgPrintMgr.ScaleMode = kCustomScale
oDrgPrintMgr.ScaleMode = PrintScaleModeEnum.kPrintBestFitScale
'oDrgPrintMgr.PaperSize = PaperSizeEnum.kPaperSizeLedger
oDrgPrintMgr.PaperSize = 14338
oDrgPrintMgr.PrintRange = kPrintCurrentSheet
oDrgPrintMgr.Orientation = kLandscapeOrientation
oDrgPrintMgr.PaperSource = 2
oDrgPrintMgr.AllColorsAsBlack = True
oDrgPrintMgr.SubmitPrint
']

0 Likes
2,118 Views
7 Replies
Replies (7)
Message 2 of 8

bradeneuropeArthur
Mentor
Mentor

Hi,

 

You need to change the printersetting themselves.

go to your paper setting of the printer and change it there.

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 8

Jason.Rugg
Collaborator
Collaborator

@bradeneuropeArthur Thanks for the suggestion but I have tried that.

0 Likes
Message 4 of 8

Jason.Rugg
Collaborator
Collaborator

@bradeneuropeArthur I am just removing the paper size callouts since the printer defaults to 11x17. One other issue I am having is black and white versus color. I want prints to be black and white, is there a different way of calling out that option in my code? The way it is it prints color.

0 Likes
Message 5 of 8

bradeneuropeArthur
Mentor
Mentor

first change this:

oDrgPrintMgr.PaperSize = kPaperSizeLetter ' or 14353

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 8

bradeneuropeArthur
Mentor
Mentor

regarding the color:

Color print is as follows:

oDrgPrintMgr.AllColorsAsBlack = False

Black and white is as follows:

oDrgPrintMgr.AllColorsAsBlack = True

The code works fine with me....

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 8

Jason.Rugg
Collaborator
Collaborator

This worked or even just completely commenting out paper size altogether worked since default is 11 x 17.

oDrgPrintMgr.PaperSize = PaperSizeLedger

 

Just need to figure out the color issue. Using: "oDrgPrintMgr.AllColorsAsBlack = True" still prints in color.

0 Likes
Message 8 of 8

bradeneuropeArthur
Mentor
Mentor

the following works fine here...

Public Sub Main()

'Print Setup
'[
Dim oDrgDoc As DrawingDocument
oDrgDoc = ThisApplication.ActiveDocument
' Set reference to drawing print manager' DrawingPrintManager has more options than PrintManager' as it's specific to drawing document
Dim oDrgPrintMgr As DrawingPrintManager
oDrgPrintMgr = oDrgDoc.PrintManager
' Set the printer name' comment this line to use default printer or assign another one
'oDrgPrintMgr.Printer = "\\kcidc2012\EngineeringSharp_Ledger"
'oDrgPrintMgr.Printer = "EngineeringSharp_Ledger"
oDrgPrintMgr.Printer = "\\kcidc2012\EngineeringSharp_Ledger"
'Set the paper size , scale and orientation
oDrgPrintMgr.ScaleMode = kCustomScale
oDrgPrintMgr.ScaleMode = PrintScaleModeEnum.kPrintBestFitScale
'oDrgPrintMgr.PaperSize = PaperSizeEnum.kPaperSizeLedger
oDrgPrintMgr.PaperSize = kPaperSizeLedger 'or 14341' kPaperSizeLetter
MsgBox (oDrgPrintMgr.PaperSize)
oDrgPrintMgr.PrintRange = kPrintCurrentSheet
oDrgPrintMgr.Orientation = kLandscapeOrientation
oDrgPrintMgr.PaperSource = 2
oDrgPrintMgr.AllColorsAsBlack = True
oDrgPrintMgr.SubmitPrint

End Sub

what version of inventor are you using?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes