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