Automatic setting the correct printer by sheet size

Automatic setting the correct printer by sheet size

Milan_Nosil
Advocate Advocate
1,037 Views
4 Replies
Message 1 of 5

Automatic setting the correct printer by sheet size

Milan_Nosil
Advocate
Advocate

Hello,

 

I have one issue with printing. When I print manydrawings and gradually open the drawings, I always have to select the correct printer according to the sheet size. 

 

Can this be automated?  I would like to open a drawing in Inventor, press print and do not have to manually change the printer.

 

I use Vault basic 2020 and I do not have drawings in one folder.

(Inventor 2020, Vault 2020)

 

Thank you very much for any advice.

Milan

0 Likes
Accepted solutions (1)
1,038 Views
4 Replies
Replies (4)
Message 2 of 5

Sergio.D.Suárez
Mentor
Mentor

Hi, have you tried setting up the printer you need from "Print Setup"?

1.jpg2.jpg

Through ilogic code you could do it through

Dim oDoc As DrawingDocument = ThisDoc.Document
'View the current printer
MessageBox.Show(oDoc.PrintManager.Printer)
'Set type of printer
oDoc.PrintManager.Printer = "Fax"

By executing that segment of code in a drawing file you can get / set the type of printer you want


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 5

Milan_Nosil
Advocate
Advocate

Thank you for your idea.

The solution will be through the iLogic rule.

One printer prints A3 and A4 size sheets and the other prints A2, A1 and A0.

Could be create a rule that automatically detects the sheet size (without printing settings), sets the correct printer, and opens the print dialog? 😅

 

Thank you very much.

Milan

0 Likes
Message 4 of 5

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Regardless of the type of sheet, you could take the measurements of the sheet, the width or height and generate the ruler from this data

Dim oDoc As DrawingDocument = ThisDoc.Document

For Each oSheet As Sheet In oDoc.Sheets
	If oSheet.Width = 21.0 Then'A4
		oDoc.PrintManager.Printer = "Fax"
		MessageBox.Show(oDoc.PrintManager.Printer & " -> Sheet A4")
	ElseIf oSheet.Width = 29.7 Then 'A3
		oDoc.PrintManager.Printer = "OneNote"
		MessageBox.Show(oDoc.PrintManager.Printer & " -> Sheet A3")
	ElseIf oSheet.Width = 42.0 Then 'A2
		oDoc.PrintManager.Printer = "Fax"
		MessageBox.Show(oDoc.PrintManager.Printer & " -> Sheet A2")
	ElseIf oSheet.Width = 59.4 Then 'A1
		oDoc.PrintManager.Printer = "OneNote"
		MessageBox.Show(oDoc.PrintManager.Printer & " -> Sheet A1")
	End If
Next

 You should complete the rule with your printers data for each type of sheet. If you use the vertical sheets and in other cases as horizontal you should recondition the rule. In this simple code you will measure the sheets vertically by default. I hope this can help you in your work. Cheers!


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 5 of 5

Milan_Nosil
Advocate
Advocate

Thank you very much! 👍

0 Likes