Rename sheets with part number, description, rev & sheet number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
Wondering if someone could just give me a hand? I wrote a ilogic to rename all my sheets with the part number, description and then Revision, then put it in event triggers so on save it would automatically rename.
I use this when doing drawings that contain multi sheets with the assemblies and parts so can run in to 100s of sheets sometimes. This works very well, the one problem i have is when i run my other ilogic for PDF individual sheets. due to some of the sheets being named the same it will only produce 1 of the sheets missing out the or copying over the same named pdf.
Is there any way i can add an additional part to the name so on sheets that are named the same they have sheet 1, sheet 2 etc?
eg.
10000-00001 PUMP ASSEMBLY - REV A - SHEET 1
10000-00001 PUMP ASSEMBLY - REV A - SHEET 2
10000-00002 PUMP PART 1 - REV A
10000-00003 PUMP PART 2 - REV A
10000-00004 PUMP PART 3 - REV A - SHEET 1
10000-00004 PUMP PART 3 - REV A - SHEET 2
Sub Main If TypeOf ThisDoc.Document Is DrawingDocument Then Dim dwgDoc As DrawingDocument = ThisDoc.Document For Each dwgSheet As Sheet In dwgDoc.Sheets If dwgSheet.DrawingViews.Count > 0 Then modelFile = dwgSheet.DrawingViews(1).ReferencedDocumentDescriptor.FullDocumentName modelDoc = dwgSheet.DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument prtNumber = modelDoc.PropertySets("Design Tracking Properties").Item("Part Number").Value & " " & _ modelDoc.PropertySets("Design Tracking Properties").Item("Description").Value & " - REV " & _ modelDoc.PropertySets("Summary Information").Item("Revision Number").Value If Not String.IsNullOrEmpty(prtNumber) Then dwgSheet.Name = prtNumber End If End If Next End If End Sub

