Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
2076 Views, 6 Replies

iLogic to Name Drawing Sheet as Sheet Number

I need help naming my sheets with the active sheets part number plus the sheet number. I have the part number portion working correctly but I cant get the sheet number portion to work. In the end I'm wanting my sheet name to look like "aaaaaab" (where as a=part number and b=sheet number).

 

Here is what I have so far:

 

SyntaxEditor Code Snippet

Dim oSheets As Sheets = ThisDrawing.Document.sheets
Dim oSheet As Sheet
Dim SheetNumber As Integer

For Each oSheet In oSheets
    oSheet.activate
    oModel = IO.Path.GetFileName(ActiveSheet.View("ISO").ModelDocument.FullFileName)
    'MessageBox.Show(oModel)
    oDoc = ThisDoc.Document
    SheetNumber  = Mid(oDoc.ActiveSheet.Name, InStr(1, oDoc.ActiveSheet.Name, ":") + 1)
    partnum = iProperties.Value(oModel, "Project", "Part Number")("SheetNumber")
    'MessageBox.Show(partnum)
    ActiveSheet.Sheet.Name = partnum
Next

 

 

Tags (1)