- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having issues trying to get pdf files from drawings.
I iterate through my assembly I need to create for drawings if they exist.
I had this working in iLogic but its not working in VB.Net.
Public Sub PublishPDF(ByRef DrawingFName As String)
Dim PDFAddIn As Inventor.TranslatorAddIn
PDFAddIn = invApp.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
Dim oContext As Inventor.TranslationContext
oContext = invApp.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oOptions As Inventor.NameValueMap
oOptions = invApp.TransientObjects.CreateNameValueMap
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 0
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
oOptions.Value("Custom_Begin_Sheet") = 1
oOptions.Value("Custom_End_Sheet") = 1
Dim oDataMedium As Inventor.DataMedium
oDataMedium = invApp.TransientObjects.CreateDataMedium
Dim oDrawName As String ' Use to store drawing filename. Remove path, extension and replace with PDFFoldername and pdf extension
oDrawName = PDFFolderName + "\" + System.IO.Path.GetFileNameWithoutExtension(DrawingFName) + ".pdf"
oDataMedium.FileName = oDrawName
Call PDFAddIn.SaveCopyAs(DrawingFName, oContext, oOptions, oDataMedium)
Solved! Go to Solution.