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
Solved! Go to Solution.
Solved by Andrii_Humeniuk. Go to Solution.
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.
Can't find what you're looking for? Ask the community or share your knowledge.