Message 1 of 18
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We are now using our Vault to store all of our PDFs, where this use to be a shared drive. How can I check in a PDF after it is created? "VaultCheckInTop" Only gets my drawing and model, doesn't recognize the PDF. I've posted my entire code but all I need to do is Check In the PDF. Any ideas?
Dim invApp As Inventor.Application = ThisApplication
Dim doc As Document = ThisApplication.ActiveDocument
Dim PDFAddIn As Inventor.ApplicationAddIn
Dim oContext As TranslationContext
Dim oOptions As NameValueMap
Dim pdfDataMedium As DataMedium
CurFileName = doc.FullFileName
'defines backslash As the subdirectory separator
Dim strCharSep As String = System.IO.Path.DirectorySeparatorChar
'find the postion of the last backslash in the path
FNamePos = InStrRev(CurFileName, "\", -1)
'get the file name with the file extension
Name = Right(CurFileName, Len(CurFileName) - FNamePos)
'get the file name (without extension)
ShortName = Left(Name, Len(Name) - 4)
'get the path of the folder containing the file
Folder_Location = Left(CurFileName, Len(CurFileName) - Len(Name))
'start pdf addin. save current file as pdf.
PDFAddIn = invApp.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oContext = invApp.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = invApp.TransientObjects.CreateNameValueMap
pdfDataMedium = invApp.TransientObjects.CreateDataMedium
If PDFAddIn.HasSaveCopyAsOptions(pdfDataMedium, oContext, oOptions) Then
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
End If
pdfDataMedium.FileName = Folder_Location & "\" & doc.DisplayName & ".PDF"
Call PDFAddIn.SaveCopyAs(doc, oContext, oOptions, pdfDataMedium)
'set text box to complete notification
MessageBox.Show("PDF has been saved", "PDF Saved")
ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckintop").Execute2(False)'Check In
Solved! Go to Solution.

