
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
At the moment i am looking for a solution to save pdf files from the idw files with a ilogic rule.
This rule, as shown, is used at the moment but has no functionality to create a path on a different harddrive in our network, with the same folder structure as the folder structure of the idw file. With this rule all the pdf files are saved in the same folder: J:\PDF_Files_Inventor.
For example a idw file is located here in the workspace: C:\VaultWorkspace\Designs\2014\1410\18871\example.idw I would like that the ilogic rule creates new folders on the J drive like: J:\2014\1410\18871\example.pdf
oPath = "J:\PDF_Files_Inventor"
oFileName = ThisDoc.FileName(False) 'without extension
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 0
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If
'get PDF target folder path
oFolder = Left(oPath, InStrRev(oPath, "\")) & "PDF_Files_Inventor"
'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If
'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf"
'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
Can anyone give me tips to make this rule more advanced.
Thanks,
Marco
Solved! Go to Solution.