Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Auto Size for printing from Inventor

luntzj
Explorer

Auto Size for printing from Inventor

luntzj
Explorer
Explorer

Is it not possible that Inventor can set the Paper Size of a printed drawing to match the Sheet size? It seems to be possible with Task Scheduler, but for the life of me I cannot seem to figure out a way to do it directly within in Inventor.

 

If it is true, is there some workaround such as iLogic code?

 

It must drive other people bonkers to have to first remind themselves of the paper size and then frequently toggle it back and forth when printing multiple drawings!(?)

 

Edit: per request, I've added screenshots of the print dialogue I see when printing to paper and to pdf. I'm using Inventor Professional 2023.

 

 

 

0 Likes
Reply
Accepted solutions (1)
645 Views
12 Replies
Replies (12)

CGBenner
Community Manager
Community Manager

@luntzj 

Welcome ot the Inventor forum.  Can you please share some more details for the experts here?  What version of Inventor are you working with?  Can you share some screen captures of your printer settings and what you are seeing that is causing you the problems?  That would make it easier for the experts to give you some advice.  Thank you and good luck!


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project

blandb
Mentor
Mentor

Didn't there used to be an Inventor batch plot utility in previous releases? My Mind escapes me anymore lol.

Autodesk Certified Professional
0 Likes

CGBenner
Community Manager
Community Manager

@blandb You might be thinking of Vault?


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project
0 Likes

CGBenner
Community Manager
Community Manager

@luntzj Hello, do you still need help with this question?


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project
0 Likes

luntzj
Explorer
Explorer

@CGBenner wrote:

@luntzjHello, do you still need help with this question?


yes

0 Likes

CGBenner
Community Manager
Community Manager

@luntzj 

Since the output paper size is set in the printer dialog, and there are so many different printers available, this would probably need to be either a customization, or an enhancement request.

I will move this post to the Inventor programming forum, to see if anyone there has any cool ideas for you.


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project
0 Likes

luntzj
Explorer
Explorer

so, to be clear, everyone using Inventor is currently working through the numerous button clicks every time they print to paper or pdf in order to manually match the output Paper size to the drawing size?! 

Further, if they want to print a batch of drawings of different sizes - you either must do it in Task Scheduler or work through each one paying attention to the drawing size and toggling the Paper size back and forth as you print each one(?).

 

It seems to me other programs don't have this issue. e.g. AutoCAD, Word, Solidworks, etc. For example, in AutoCAD it seems that the file contains information regarding the desired Paper size and then when you select a printer, it automatically tries to select that paper size from within the printer drivers options. 

I guess I was hoping to find out I had some setting or driver setup incorrectly - especially since nobody else seems to be asking about this. 

0 Likes

J_Pfeifer_
Advocate
Advocate

Whew, It's alright man. No we're not all printing each thing manually. However, you still need to create a program that can take into account the logic needed. Hard to automate something to auto select the one you want, without telling the program to understand its position. 

 

Below you will see my printing script, you will see that the function of my script is to change the place the main symbol object on the front sheet. It changes these depending on the Shop requested order. If I needed to change the sheet size of any of these, I would just set the variable in the beginning to another size enum and print. 

So instead of placing a new symbol, I could make this alternate sheet sizes as it prints each item. 

 

This produces a total of 8 finished job read prints of the drawing. Each with the proper identifier on the front sheet, in the order specified by the managers out in production. 

 

Attached is my printing script:

 

Sub main()
	
	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	
	Dim oSheet1 As Sheet = oDoc.Sheets.Item(1)
        try 
	Dim oSheet2 As Sheet = oDoc.Sheets.Item(2)
	Dim oSheet3 As Sheet = oDoc.Sheets.Item(3)
	Dim oSheet4 As Sheet = oDoc.Sheets.Item(4)
	catch
        end try
	Dim PrintManager As DrawingPrintManager = oDoc.PrintManager
	
	PrintManager.Printer = "Drafting"

	PrintManager.ScaleMode = kPrintBestFitScale
	PrintManager.PaperSize = kPaperSize11x17
	'PrintManager.PaperSize = kPaperSizeLetter
	PrintManager.PrintRange = kPrintAllSheets
	'PrintManager.PrintRange = kPrintCurrentSheet
	PrintManager.Orientation = kLandscapeOrientation
	
	Dim CheckedLocations As Boolean = False
	Dim iIndex As Integer = 1
	
	Try
	If Checked_And_Located = False Then 
		Call PlaceJobNumber()
		Call PlaceMe()
		'Call JobNumberDelete() 'Checking to make sure item is deleted after printing. 
		CheckedLocation = True
	Else 
		MessageBox.Show("You must run and place the items before running the rule")
	End If
	Catch
		MessageBox.Show("Please unselect any check box and run rule.")
	End Try
	'Added double checking boxes, both must be selected for the rule to print. 
	If Checked_And_Located = True and Notes_Confirmed = True Then 
		
		Call CollectLocations(FirstLoc)
		Call DeleteAll()
		
		Call ForemanApply(FirstLoc)
			Thread.Sleep(2000)
			PrintManager.SubmitPrint
			Logger.Info("Print Foreman")
		Call DeleteAll()
		Call TankAssyApply(FirstLoc)
		
		'Print x3 Of the tank assembly
			Do While iIndex <= 3
				Thread.Sleep(2000)
				PrintManager.SubmitPrint
				iIndex = iIndex + 1
				Logger.Info("Print tank assy #: " & iIndex)
			Loop
			
		Call DeleteAll()
		
		Call ForemanApply(FirstLoc)
			Thread.Sleep(2000)
			PrintManager.SubmitPrint
			Logger.Info("Print Foreman")
		Call DeleteAll()
		
		Call TankRoomApply(FirstLoc)
			Thread.Sleep(2000)
			PrintManager.SubmitPrint
			Logger.Info("Print Tank room")
		Call DeleteAll()
		
		Call FittingsApply(FirstLoc)
		 	Thread.Sleep(2000)
			PrintManager.SubmitPrint
			Logger.Info("Print FITTINGS")
		Call DeleteAll()
		
		Call TankAssyApply(FirstLoc)
			Thread.Sleep(2000)
			PrintManager.SubmitPrint
			Logger.Info("Print tank assy")
		Call DeleteAll
		Call JobNumberDelete()
	
	End If 
End Sub


Sub FittingsApply(ByVal FirstLoc As Point2d)

	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	
	Dim FittingsSymDef As SketchedSymbolDefinition = oDoc.SketchedSymbolDefinitions.Item("FITTINGS")
	
	Dim oSheet1 As Sheet = oDoc.Sheets.Item(1)
	Try
	Dim oSheet2 As Sheet = oDoc.Sheets.Item(2)
	Dim oSheet3 As Sheet = oDoc.Sheets.Item(3)
	Dim oSheet4 As Sheet = oDoc.Sheets.Item(4)
	Catch
		MessageBox.Show("Missing sheet from default, notify Jesse")
	End Try
	
	Logger.Info("First Location X/Y: " & FirstLoc.X & " " & FirstLoc.Y)
	
	
	
	Dim FittingsSym As SketchedSymbol = oSheet1.SketchedSymbols.Add(FittingsSymDef, FirstLoc, Nothing, 1)
End Sub
Sub TankRoomApply(ByVal FirstLoc As Point2d)

	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	
	Dim TankRoomSymDef As SketchedSymbolDefinition = oDoc.SketchedSymbolDefinitions.Item("TANK ROOM")
	
	Dim oSheet1 As Sheet = oDoc.Sheets.Item(1)
	Try
	Dim oSheet2 As Sheet = oDoc.Sheets.Item(2)
	Dim oSheet3 As Sheet = oDoc.Sheets.Item(3)
	Dim oSheet4 As Sheet = oDoc.Sheets.Item(4)
	Catch
		MessageBox.Show("Missing sheet from default, notify Jesse")
	End Try
	
	
	Logger.Info("First Location X/Y: " & FirstLoc.X & " " & FirstLoc.Y)

	Dim TankRoomSym As SketchedSymbol = oSheet1.SketchedSymbols.Add(TankRoomSymDef, FirstLoc, Nothing, 1)
	
End Sub
Sub TankAssyApply(ByVal FirstLoc As Point2d)

	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	
	Dim TankAssySymDef As SketchedSymbolDefinition = oDoc.SketchedSymbolDefinitions.Item("TANK ASSY")
	
	Dim oSheet1 As Sheet = oDoc.Sheets.Item(1)
	Try
	Dim oSheet2 As Sheet = oDoc.Sheets.Item(2)
	Dim oSheet3 As Sheet = oDoc.Sheets.Item(3)
	Dim oSheet4 As Sheet = oDoc.Sheets.Item(4)
	Catch
		MessageBox.Show("Missing sheet from default, notify Jesse")
	End Try
	
	Logger.Info("First Location X/Y: " & FirstLoc.X & " " & FirstLoc.Y)

	Dim TankAssySym As SketchedSymbol = oSheet1.SketchedSymbols.Add(TankAssySymDef, FirstLoc, Nothing, 1)

End Sub
Sub ForemanApply(ByVal FirstLoc As Point2d)

	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	
	Dim ForemanSymDef As SketchedSymbolDefinition = oDoc.SketchedSymbolDefinitions.Item("FOREMAN")
	
	Dim oSheet1 As Sheet = oDoc.Sheets.Item(1)
	Try
	Dim oSheet2 As Sheet = oDoc.Sheets.Item(2)
	Dim oSheet3 As Sheet = oDoc.Sheets.Item(3)
	Dim oSheet4 As Sheet = oDoc.Sheets.Item(4)
	Catch
		MessageBox.Show("Missing sheet from default, notify Jesse")
	End Try
	
	
	Logger.Info("First Location X/Y: " & FirstLoc.X & " " & FirstLoc.Y)
		
	Dim ForemanSym As SketchedSymbol = oSheet1.SketchedSymbols.Add(ForemanSymDef, FirstLoc, Nothing, 1)

End Sub
Sub PlaceMe()
	
	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim PlaceMeDef As SketchedSymbolDefinition = oDoc.SketchedSymbolDefinitions.Item("PLACE ME")
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	
	'Starting / default setting
	Dim SymbolPosition As Point2d = oTG.CreatePoint2d(30.5, 9.5)
	Dim SymbolPosition1st As Point2d = oTG.CreatePoint2d(34.7, 7.375)
	
	Dim oSheet As Sheet = oDoc.Sheets.Item(1)
	
	Dim oSymbol As SketchedSymbol = Nothing 

	oSymbol = oSheet.SketchedSymbols.Add(PlaceMeDef, SymbolPosition1st, Nothing, 1)
		
End Sub 
Sub DeleteAll()
	
	'Checks every sheet, then all the sketched symbol objects on that sheet. Deletes any that are named from this rule. 
	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	For Each oSheet As Sheet In oDoc.Sheets
		For Each oSymbol As SketchedSymbol In oSheet.SketchedSymbols
			If oSymbol.Definition.Name = "FOREMAN"
				oSymbol.Delete
			Else If oSymbol.Definition.Name = "TANK ASSY"
				oSymbol.Delete
			Else If oSymbol.Definition.Name = "TANK ROOM"
				oSymbol.Delete
			Else If oSymbol.Definition.Name = "FITTINGS"
				oSymbol.Delete
			Else If oSymbol.Definition.Name = "PLACE ME"
				oSymbol.Delete
			End If 
		Next
	Next	
End Sub ' THis is fine due to its natural creation
Sub CollectLocations(ByRef FirstLoc As Point2d)
	
	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim i As Integer = 1
	Dim iSheet As Integer = 1
	Dim oSheet As Sheet = oDoc.Sheets.Item(1)
	
	FirstLoc = Nothing
	SecondLoc = Nothing
	ThirdLoc = Nothing 	
	FourthLoc = Nothing
	
	'goes through each sheet and sketched symbol object. Grabs the position set by the user, then passes those locations into the real notes to be added at printing. 
	
        For Each oSymbol As SketchedSymbol In oSheet.SketchedSymbols
			If oSymbol.Definition.Name = "PLACE ME" Then 
					FirstLoc = oSymbol.Position	
			End If 
		Next
		
	
	
	Logger.Info("First Location X/Y: " & FirstLoc.X & " " & FirstLoc.Y)

	
End Sub
Sub PlaceJobNumber()
	
	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oTO As TransientObjects = ThisApplication.TransientObjects
	
	Dim oSheet As Sheet = oDoc.Sheets.Item(1)
	
	Dim JobNumberDef As SketchedSymbolDefinition = oDoc.SketchedSymbolDefinitions.Item("Number")
	
	Dim NumberLoc As Point2d = oTG.CreatePoint2d(30, 16)
	
	Dim UserInput As String = Last_Three_Job_No
	
	Dim PromptedStrings As String() = {UserInput}
	
	
	'For Each otextbox As Inventor.TextBox In JobNumberDef
	'	If otextbox.Text.Contains("<Number>") = True Then 
	'		otextbox.Text = UserInput
	'	End If
	'Next
	
	Dim JobNumberSym As SketchedSymbol = oSheet.SketchedSymbols.Add(JobNumberDef, NumberLoc, Nothing, 1, PromptedStrings)
End Sub
Sub JobNumberDelete()

	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oTO As TransientObjects = ThisApplication.TransientObjects
	
	Dim oSheet As Sheet = oDoc.Sheets.Item(1)
	
	
	
	For Each oSymbol As SketchedSymbol In oSheet.SketchedSymbols
		If oSymbol.Definition.Name = "Number" = True Then 
			oSymbol.Delete
		End If
	Next
End Sub

 

luntzj
Explorer
Explorer

Thank you for sharing this. I think I know enough about coding that I could tweak it and I think this code has a ton of things I could use.

However, I'm still a little confused at what this code is doing - it looks to me like you are hardcoding in the paper size in lines 16 through 21. What I am wanting to do is obtain the Drawing size from the idw file and then set the Paper Size to be the same for each printed drawing. 

0 Likes

J_Pfeifer_
Advocate
Advocate

I see, and you're correct this hard sets the sheet size at the beginning as all of my drawing would be under that same size. I personally do not use the IDW file type, but I dont see anything in the documentation that would imply that it gets referenced differently. 

 

Looking through the drawing document object, I was looking for something that would return the base sheet size. Or the size the sheet loaded in as. It could be in one of the options that returns the sheet or document information, but im just not seeing it. 

 

Ah, It's inside the sheet size. You need to get to the sheet object. Once there you can do something like  oSheet1.size(). This will give you the sheet size property. Then make a case statement that depending on the sheet size enum. You change kPaperSizeenum to match the size of the sheet. 

 

I was hoping you could just pass the sheet size enum into the printer option, but the selection is a different type. This would require you create a selection system that properly inputs the print size. 

 

Attached links: 

sheet: https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=Sheet

Sheet size : https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=Sheet_Size

Print manager: https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=DrawingPrintManager

Paper size: https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=PaperSizeEnum

 

Eddited to add: Theoretically you could do it manually by measuring the sheet size and using that size to use a case statement selecting the correct papersizeenum. You can access this by osheet1.width or osheet1.height = returned in CM. Then using those returned sizes select the proper printer paper size. 

J_Pfeifer_
Advocate
Advocate
Accepted solution

I wrote something up that's much more direct in how to do something like you asked. Note, this has not been tested but it shows the exact logic I'd use in two different ways to solve this problem. I noticed some missing or weird overlaps between the drawing sheet size and paper size. These might need to be accounted for in multiple ways. That is you may not be able to use a single method in this pasted code. It may require more than one. 

 

Lastly, I would move the selections into a sub routine. This way you can call the sub when you need to make a new selection on or from a different sheet. 

 

 

Sub main()
	
	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim Printmanager As PrintManager = oDoc.PrintManager
	
	Printmanager.ScaleMode = kPrintBestFitScale
	Printmanager.PrintRange = kPrintAllSheets
	Printmanager.Orientation = kLandscapeOrientation
	
	Dim Sheetsize As DrawingSheetSizeEnum = Nothing
	
	For Each osheet As Sheet In oDoc.Sheets
		If osheet IsNot Nothing Then 
			Sheetsize = osheet.Size()
			Logger.Info("Sheet object size: " & osheet.Size.ToString & " Sheet size: " & Sheetsize.ToString)
		End If 
	Next
	
	Dim PaperSizeSel As PaperSizeEnum = Nothing
	
	Dim osheet1 As Sheet = Nothing
	Try 'Placed into try block as this isnt the best way to get access to the sheet. Try to make it dynamic so this doesnt error. 
		osheet1 = oDoc.Sheets.Item(1)
	Catch
	End Try
	
		'Inside the webpages describing each item, you see a numeric value, for example Ddrawing size is value = 9990. You may want to experiment what you need to pass for ojects here
		'Strings, enumerators as shown, or maybe change the varable type and simplye use the values. Many options. 
		Select Case Sheetsize
		
		Case DrawingSheetSizeEnum.kDDrawingSheetSize
			
			PaperSizeSel = PaperSizeEnum.kPaperSizeDSheet
	
		Case DrawingSheetSizeEnum.kA1DrawingSheetSize
			
			PaperSizeSel = PaperSizeEnum.kPaperSizeA1
		
		Case Else 
		
			MessageBox.Show("Incorrect size selected doing manual check")
			
		End Select
				
	'Apply the changes to the print manager
	
	Printmanager.PaperSize = PaperSizeSel
		
				
				
				
	Dim sheetwidth As Double = Nothing
	Dim sheetheight As Double = Nothing

	sheetwidth = osheet1.Width
	sheetheight = osheet1.Height
	
	
	If sheetwidth = 17 * 2.54 And sheetheight = 11 * 2.54 Then 
		PaperSizeSel = PaperSizeEnum.kPaperSize11x17
	Else	
		'continue depending. 
	End If
	
	
	'or again apply the changes as needed
	
	Printmanager.PaperSize = PaperSizeSel
	

	
End Sub

 

 

If you feel I fulfilled your question, a solution would be greatly appreciated!

luntzj
Explorer
Explorer

Thank you. Yes, I think this gives me the bits I need. I believe I'll use this in conjunction with another thread I found and play with it.

 

... I can't help but still be skeptical that this is the default Inventor behavior.

0 Likes