I'm using Inventor and Vault 2023, and my workspace is based on my C: drive. The company I work for uses a network drive (common NAS device) as well to access engineering documents. Is there a way to set up iLogic triggers or rules where when I publish a PDF to my C: drive, it publishes to our M: drive (network drive from above) as well? Are there any tools in the Vault job processor that would aid in this? Should I just bite the bullet and take the few extra keystrokes to publish to multiple drives or copy/paste my drawings over instead of trying to automate this task? Any suggestions or alternatives would be appreciated! Thanks!
Solved! Go to Solution.
I'm using Inventor and Vault 2023, and my workspace is based on my C: drive. The company I work for uses a network drive (common NAS device) as well to access engineering documents. Is there a way to set up iLogic triggers or rules where when I publish a PDF to my C: drive, it publishes to our M: drive (network drive from above) as well? Are there any tools in the Vault job processor that would aid in this? Should I just bite the bullet and take the few extra keystrokes to publish to multiple drives or copy/paste my drawings over instead of trying to automate this task? Any suggestions or alternatives would be appreciated! Thanks!
Solved! Go to Solution.
Solved by Michael.Navara. Go to Solution.
I like to use the api control definition commands instead of iLogic when exporting pdf's. Here is an example:
You can make it an event trigger 'After Save' and it works too.
Dim oName As String = ThisDrawing.Name & ".pdf" Dim oCmd As ControlDefinition oCmd = ThisApplication.CommandManager.ControlDefinitions.Item("AppFileExportPDFCmd") cfilelocation = "C:\temp\" mfilelocation = "M:\Folder1\" ThisApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, cfilelocation & oName) oCmd.Execute
I like to use the api control definition commands instead of iLogic when exporting pdf's. Here is an example:
You can make it an event trigger 'After Save' and it works too.
Dim oName As String = ThisDrawing.Name & ".pdf" Dim oCmd As ControlDefinition oCmd = ThisApplication.CommandManager.ControlDefinitions.Item("AppFileExportPDFCmd") cfilelocation = "C:\temp\" mfilelocation = "M:\Folder1\" ThisApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, cfilelocation & oName) oCmd.Execute
You can use any iLogic rule for export to PDF. Setup the output to your C:\ drive and later on copy the file to M:\
Something like this code snippet
Sub Main()
CADS_PubblishPDF()
End Sub
Sub CADS_PubblishPDF()
' Get the PDF translator Add-In.
Dim PDFAddIn As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
' a reference to the active document (the document to be published).
Dim oDocument As Document = ThisApplication.ActiveDocument
Dim oContext As TranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium = ThisApplication.TransientObjects.CreateDataMedium
oOptions.Value("Sheet_Range") = PrintRangeEnum.kPrintAllSheets
' Check whether the translator has 'SaveCopyAs' options
If PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
' Options for drawings...
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
oOptions.Value("All_Color_AS_Black") = 0
'oOptions.Value("Remove_Line_Weights") = 0
'oOptions.Value("Vector_Resolution") = 400
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If
' the destination file name
Dim pdfFileNameLocal = ThisDoc.PathAndFileName(False) & ".pdf"
oDataMedium.FileName = pdfFileNameLocal
'Publish document.
Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'Copy file to Network drive
Dim pdfFileNameOnNetworkDrive = "M:\" & ThisDoc.FileName(False) & ".pdf"
System.IO.File.Copy(pdfFileNameLocal, pdfFileNameOnNetworkDrive)
End Sub
You can use any iLogic rule for export to PDF. Setup the output to your C:\ drive and later on copy the file to M:\
Something like this code snippet
Sub Main()
CADS_PubblishPDF()
End Sub
Sub CADS_PubblishPDF()
' Get the PDF translator Add-In.
Dim PDFAddIn As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
' a reference to the active document (the document to be published).
Dim oDocument As Document = ThisApplication.ActiveDocument
Dim oContext As TranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium = ThisApplication.TransientObjects.CreateDataMedium
oOptions.Value("Sheet_Range") = PrintRangeEnum.kPrintAllSheets
' Check whether the translator has 'SaveCopyAs' options
If PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
' Options for drawings...
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
oOptions.Value("All_Color_AS_Black") = 0
'oOptions.Value("Remove_Line_Weights") = 0
'oOptions.Value("Vector_Resolution") = 400
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If
' the destination file name
Dim pdfFileNameLocal = ThisDoc.PathAndFileName(False) & ".pdf"
oDataMedium.FileName = pdfFileNameLocal
'Publish document.
Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'Copy file to Network drive
Dim pdfFileNameOnNetworkDrive = "M:\" & ThisDoc.FileName(False) & ".pdf"
System.IO.File.Copy(pdfFileNameLocal, pdfFileNameOnNetworkDrive)
End Sub
Thanks for the reply. I don't have the API tools installed on my machine currently- do you use developer or user tools to execute the code you're suggesting?
Thanks for the reply. I don't have the API tools installed on my machine currently- do you use developer or user tools to execute the code you're suggesting?
No, this is just iLogic rule. You don't need to install anything special
No, this is just iLogic rule. You don't need to install anything special
Thanks for the help! Looking forward to trying some of this out.
Thanks for the help! Looking forward to trying some of this out.
Can't find what you're looking for? Ask the community or share your knowledge.