Hi all,
I use the ilogic rule below to automatically export the drawings in PDF.
It was previously triggered with "after save" event, but that was causing problems with the Vault checking in.
Then I changed it to "before save" event. The issue now is with the first save, because the file and the path doesn't exist is giving error. Any suggestion how to solve it?
WorkspacePath = ThisDoc.WorkspacePath()
WorkspacePathLength = Len(WorkspacePath)
PathOnly = ThisDoc.Path
DirectoryPath = Strings.Right(PathOnly, PathOnly.Length - WorkspacePathLength)
PDFPath = "C:\Users\....\PDFs" & DirectoryPath
If (Not System.IO.Directory.Exists(PDFPath)) Then
System.IO.Directory.CreateDirectory(PDFPath)
End If
ThisDoc.Document.SaveAs(PDFPath & "\" & ThisDoc.FileName(False) & ".pdf" , True)
Hi all,
I use the ilogic rule below to automatically export the drawings in PDF.
It was previously triggered with "after save" event, but that was causing problems with the Vault checking in.
Then I changed it to "before save" event. The issue now is with the first save, because the file and the path doesn't exist is giving error. Any suggestion how to solve it?
WorkspacePath = ThisDoc.WorkspacePath()
WorkspacePathLength = Len(WorkspacePath)
PathOnly = ThisDoc.Path
DirectoryPath = Strings.Right(PathOnly, PathOnly.Length - WorkspacePathLength)
PDFPath = "C:\Users\....\PDFs" & DirectoryPath
If (Not System.IO.Directory.Exists(PDFPath)) Then
System.IO.Directory.CreateDirectory(PDFPath)
End If
ThisDoc.Document.SaveAs(PDFPath & "\" & ThisDoc.FileName(False) & ".pdf" , True)
What do you expect during the first save?
What do you expect during the first save?
My intent is to have the drawing saved as PDF automatically replicating the workspace folder tree.
I understand that the "before save" for the first save doesn't find the path and file name.
The "after save" would be the suitable trigger for that, but as I said in the first post, it messes with the Vault.
So I was wandering if someone has a solution for it, a different trigger or another way to achieve it.
Thanks.
My intent is to have the drawing saved as PDF automatically replicating the workspace folder tree.
I understand that the "before save" for the first save doesn't find the path and file name.
The "after save" would be the suitable trigger for that, but as I said in the first post, it messes with the Vault.
So I was wandering if someone has a solution for it, a different trigger or another way to achieve it.
Thanks.
If you use a Vault, use JobProcessor and publishing jobs.
If you use a Vault, use JobProcessor and publishing jobs.
I know... but I was trying to make them accessible for the people in shopfloor. They've got some Ipads, and I was saving the files on Idrive as the only place I know they can access (without involving IT people). The workflow was working until I discovered it was creating problems checking in.
I know... but I was trying to make them accessible for the people in shopfloor. They've got some Ipads, and I was saving the files on Idrive as the only place I know they can access (without involving IT people). The workflow was working until I discovered it was creating problems checking in.
You can copy file after job to any place, you can implement your own job, etc. In this case you can export PDF ony for approved documentation.
Hypothetical question:
What happens when someone make a copy of drawing, make some changes (test, preview, ..) and save the file? Later on he can "undo changes" from Vault.
You can copy file after job to any place, you can implement your own job, etc. In this case you can export PDF ony for approved documentation.
Hypothetical question:
What happens when someone make a copy of drawing, make some changes (test, preview, ..) and save the file? Later on he can "undo changes" from Vault.
is the name of the drawing/pdf related to name of the component (from the drawing) if so then you can use the name and path of the related component. you can use document.FileSaveCounter to see how many times the file was saved. 0 means no document.FullFileName ...
is the name of the drawing/pdf related to name of the component (from the drawing) if so then you can use the name and path of the related component. you can use document.FileSaveCounter to see how many times the file was saved. 0 means no document.FullFileName ...
Usually it is the same.
I think I will click twice the save button for the first save.
Usually it is the same.
I think I will click twice the save button for the first save.
so if you work with the mono darwing system, than only one part per drawing, so take the first drawing view and get the referenced filename:
Dim drawdoc As DrawingDocument Dim filename = drawdoc.Sheets(1).DrawingViews(1).ReferencedDocumentDescriptor.FullDocumentName
then you can use this string to get the path and name for the drawing and/or PDF
so if you work with the mono darwing system, than only one part per drawing, so take the first drawing view and get the referenced filename:
Dim drawdoc As DrawingDocument Dim filename = drawdoc.Sheets(1).DrawingViews(1).ReferencedDocumentDescriptor.FullDocumentName
then you can use this string to get the path and name for the drawing and/or PDF
Can't find what you're looking for? Ask the community or share your knowledge.