Rename sheets with part number, description, rev & sheet number

Rename sheets with part number, description, rev & sheet number

M_S_ALDT2
Explorer Explorer
703 Views
10 Replies
Message 1 of 11

Rename sheets with part number, description, rev & sheet number

M_S_ALDT2
Explorer
Explorer

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

 

0 Likes
704 Views
10 Replies
Replies (10)
Message 2 of 11

bradeneuropeArthur
Mentor
Mentor

Why not naming it like?:

 

10000-00001 PUMP ASSEMBLY - REV A - SHEET 1

10000-00001 PUMP ASSEMBLY - REV A - SHEET 2

10000-00002 PUMP PART 1 - REV A - SHEET 1

10000-00003 PUMP PART 2 - REV A - SHEET 1

10000-00004 PUMP PART 3 - REV A - SHEET 1

10000-00004 PUMP PART 3 - REV A - SHEET 2

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 11

M_S_ALDT2
Explorer
Explorer

That would be acceptable, just saw it as pointless if there was only 1 sheet.

0 Likes
Message 4 of 11

bradeneuropeArthur
Mentor
Mentor

Is this working for your:

 

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 & _
					"SHEET"
                If Not String.IsNullOrEmpty(prtNumber) Then
                    dwgSheet.Name = prtNumber
                End If
            End If
        Next
    End If
End Sub

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 11

M_S_ALDT2
Explorer
Explorer

That will just add the word SHEET to the end of every sheet.

0 Likes
Message 6 of 11

bradeneuropeArthur
Mentor
Mentor

For me it look like this:

bradeneuropeArthur_1-1735845445464.png

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 11

M_S_ALDT2
Explorer
Explorer
that number after the sheet is not part of the string. so would be there on any sheet that has the same name regardless. run the original ilogic and it will have the :1, :2, etc at the end.
Message 8 of 11

bradeneuropeArthur
Mentor
Mentor

Because that number (:1 ;2) is out of the name properties this seems to be not possible?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 9 of 11

C_Haines_ENG
Collaborator
Collaborator

The :1 and :2 are just inventors background naming process so that you can always have duplicate named sheets. If you have 44 sheets the name will end in :44

0 Likes
Message 10 of 11

M_S_ALDT2
Explorer
Explorer

That's what I have already said above in response....

0 Likes
Message 11 of 11

C_Haines_ENG
Collaborator
Collaborator

I saw.

0 Likes