create PDF to external hard drive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everybody.
I would like to have a little bit of help with my rule.
I have my working folder (WF) on local drive C:\WF\9001-9500\9205 Vessel. And I have a server G:\SAGS-BIBLIOTEK\9205 Vessel. I'm looking for a rule to indificate 9205 Vessel onto the G:\SAGS-BIBLIOTEK
The two folders on both drives has the same name. Is it possible to make a rule that looks for the same name, by searching into Inventor "Project" "Part number (first 4-5 numbers) and look into the G: drive and find the same numbers and place the PDF into that folder.
So when I start a new project with a new case number (Ex. 11410) it will place a PDF drawing both to my working folder and into Ex. 11410 on the G: drive.
Does my quistions make any sence?
'------start of iLogic-------
'save a PDF to 2 different folders
Workspace = ThisDoc.WorkspacePath()
WorkspcePathLenght = Len(WorkspacePath)
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("Project", "Revision Number")
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
DirectoryPath = DirectoryPath
PDFPath = DirectoryPath
'Folder 1
oFolder1 = oPath
'Folder 2. Need a rule to indified oFolder2 with the same numbers as "Project" "Part number" (first 4-5 numbers)
'so oFolder 2 will be saved into "G:\SAGS-BIBLIOTEK\...Same number as "Part number" (first 4-5 numbers)
oFolder2 = "G:\SAGS-BIBLIOTEK\11336 Desmet Ballestra PT 130x1450 x2450 x 0.8\Tegninger"
'get the filename of the drawing
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
'Check for the PDF folder 1 and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder1) Then
System.IO.Directory.CreateDirectory(oFolder1)
End If
'Check for the PDF folder 2 and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder2) Then
System.IO.Directory.CreateDirectory(oFolder2)
End If
'Set the PDF target filename for folder 1
oDataMedium.FileName = oPath & "\" & oFileName & "_" & "Rev" &"_" & oRevNum & ".pdf"
'Publish the first document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'Set the PDF target filename for folder 2
oDataMedium.FileName = oPath & "\" & oFileName & "_" & "Rev" &"_" & oRevNum & ".pdf"
'Publish the second document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'------end of iLogic-------