Print Ilogic Rule

Print Ilogic Rule

donaldleigh
Advocate Advocate
582 Views
1 Reply
Message 1 of 2

Print Ilogic Rule

donaldleigh
Advocate
Advocate

Hi all

 

I have the attached code for printing our drawings to paper.

 

It all works except its only printing the current open sheet and not the all of them. (within the same .idw)

 

Can anyone please help

 

Inventor 2014

 

Donald

0 Likes
583 Views
1 Reply
Reply (1)
Message 2 of 2

chandra.shekar.g
Autodesk Support
Autodesk Support

@donaldleigh,

 

Hoping that below iLogic code would help to print all sheets in drawing.

'NumberCopies = InputBox("Enter Number of Copies", "Print Manager", "1")
Dim oDrawDoc As Inventor.Document
For Each oDrawDoc In ThisApplication.Documents.VisibleDocuments

	If (oDrawDoc.documenttype = kDrawingDocumentObject) Then 'Found a drawing
		Dim oSheet As Sheet 
		For Each oSheet In oDrawDoc.Sheets 
			oSheet.Activate 
			Dim oPrintMgr As PrintManager
			oPrintMgr = oDrawDoc.PrintManager

			Dim sMyPrinter As String
			sMyPrinter = "\\AWE-SVR-01\KONICA MINOLTA C284 PCL"
oPrintMgr.Printer = sMyPrinter oPrintMgr.ColorMode = kPrintDefaultColorMode oPrintMgr.PrintRange = kPrintAllSheets oPrintMgr.Orientation = kLandscapeOrientation oPrintMgr.Scale = kPrintBestFitScale oPrintMgr.PaperSize = kPaperSizeB 'oPrintMgr.NumberOfCopies = NumberCopies 'MessageBox.Show("Printed " & NumberCopies, "Title") oPrintMgr.SubmitPrint Next End If Next

For reference, go through below forum discussion link.

 

https://forums.autodesk.com/t5/inventor-customization/print-only-a4-sheets-in-a-drawing/m-p/8117919

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network