Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey I had this code solved on here before which grabs the active model's file name to name the sheet the same name, I now want to add the revision to the file name: eg File name & "-" & Rev number. I know illogic well, but logic in drawings is hard!
Sub Main() 'Purpose: Push file name to sheet name '21-Sept-16 Dim oDoc As Document = ThisApplication.ActiveDocument Dim oSheet As Sheet Dim oDrawingView As DrawingView 'Iterate through sheets For Each oSheet In oDoc.Sheets 'Grab the first drawing view on the sheet oDrawingView = oSheet.DrawingViews(1) 'Grab the model of the first drawing view oModel = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument 'Assign the sheet name based off of the file name, with the path and extension removed oSheet.Name = System.IO.Path.GetFileNameWithoutExtension(oModel.FullFileName) & "-" & o_iProp Next End Sub
Solved! Go to Solution.