- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I am running a rule that exports PDFs intelligently to a new location. Currently the rule won't work on drawings with multiple sheets.. I am looking to fix that 😋
Drawing file name: XX.XX.XXXX-S1S2S3S4RX MODELNAME PART NAME.dwg
I would like to know how to isolate the entire portion in red so that I can replace it with the proper sheet number. aka For Each sheet, output a pdf with the right sheet number in the file name. This should always replace everything between "-" and "R" with S#.
Output PDF names:
XX.XX.XXXX-S1RX MODELNAME PART NAME.pdf
XX.XX.XXXX-S2RX MODELNAME PART NAME.pdf
XX.XX.XXXX-S3RX MODELNAME PART NAME.pdf
XX.XX.XXXX-S4RX MODELNAME PART NAME.pdf
Side Note, I found this snippet and it seems like a good way to go for the numbering
Dim CurrentSheet As Integer
Dim strSheetName As String
strSheetName = oDocument.ActiveSheet.Name
If InStr(strSheetName, ":") Then
' Extract the sheet number from the name.
GetSheetNumber = CInt(Right$(strSheetName, Len(strSheetName) - InStrRev(strSheetName, ":")))
Else
'This sheet is not numbered so returnzero.
GetSheetNumber = 0
End If
CurrentSheet = "S" & GetSheetNumber
Solved! Go to Solution.