Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Save to PDF all sheets

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
felix.bouchard
184 Views, 2 Replies

Save to PDF all sheets

Hi, 

 

I have this Ilogic code that i use everyday to save the file as a pdf. This code also add the revision number to the pdf file that is created. I need to modify this code so i can save all sheets.

 

strFolder = "D:\Novathermboiler\Pdf\" & ThisDoc.FileName(False) 'without extension Dim oRev As String = iProperties.Value("Summary", "Revision Number") ThisDoc.Document.SaveAs(strFolder & ", Rev" & oRev & ".pdf", True) 'ThisDoc.Document.SaveAs(strFolder & ".pdf", True) MessageBox.Show("All file formats saved", "File Save")

 

Thanks

2 REPLIES 2
Message 2 of 3

Hi @felix.bouchard . Please try this iLogic code:

Sub main
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oDoc As Document = oInvApp.ActiveDocument
	If Not TypeOf oDoc Is DrawingDocument Then Exit Sub
		
	Dim strFolder As String = "D:\Novathermboiler\Pdf\" & ThisDoc.FileName(False)
	Dim oRev As String = iProperties.Value("Summary", "Revision Number")
	
	Dim oPDFAddIn As TranslatorAddIn = oInvApp.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	
	Dim oTO As TransientObjects = oInvApp.TransientObjects
	Dim oDataMedium As DataMedium = oTO.CreateDataMedium
	oDataMedium.FileName = strFolder & ", Rev" & oRev & ".pdf"
	
	Dim oContext As TranslationContext = oTO.CreateTranslationContext
	oContext.Type = kFileBrowseIOMechanism
	
	Dim oOptions As NameValueMap = oTO.CreateNameValueMap
	oOptions.Value("All_Color_AS_Black") = 0
	oOptions.Value("Remove_Line_Weights") = 0
	oOptions.Value("Vector_Resolution") = 400
	oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
	
	Call oPDFAddIn.SaveCopyAs(oDoc, oContext, oOptions, oDataMedium)
End Sub

 

Andrii Humeniuk - Leading design engineer

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report