Hi, help me. I would like to change my sheet name to be sequentially numbers as shown below. Thanks.
FYI,
Nomenclature :
RTU-385-001 - 385-Filter Support BT_Top 2:1
Note :
RTU-385 = .ipt > iproperties > project > stock number
<space>-<space> = separator
001,002,003,.... = sequentially numbers as sheet number (3 digit)
385-Filter Support BT_Top 2 = .ipt > iproperties > project > part number
:1,2,3,.... = sheet number
Solved! Go to Solution.
Solved by deffysalfauzi. Go to Solution.
Solved by bradeneuropeArthur. Go to Solution.
Solved by bradeneuropeArthur. Go to Solution.
Via I-logic vba or vb.net?
Via I-logic:
Public Sub main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 Next End Sub
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
Wow thanks very much. How about 3 digit number, start from 001 to 999. Likes this one :
RTU-385-001
....
RTU-385-008
RTU-385-009
RTU-385-010
....
RTU-385-999
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
is this what you need then?
Public Sub Main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value If c2<999 Then If c2<99 Then If c2<10 Then sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 End If Else sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2 End If Else sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2 End If Next End Sub
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
@bradeneuropeArthur wrote:Via I-logic vba or vb.net?
Via I-logic:
Public Sub main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 Next End Sub
ilogic from sheet 1 to 15, different from the goal likes this :
RTU-385-001 - 385-Filter Support BT_Top 2:1
....
RTU-385-008
RTU-385-009
RTU-385-010
....
RTU-385-999
Note :
RTU-385 = stock number
<space>-<space> = separator
001,002,...,099,...,999 = sequentially numbers same as sheet number (3 digit)
385-Filter Support BT_Top 2 = part number
:1,2,3,.... = sheet number
@bradeneuropeArthur wrote:is this what you need then?
Public Sub Main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value If c2<999 Then If c2<99 Then If c2<10 Then sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 End If Else sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2 End If Else sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2 End If Next End Sub
result from ilogic :
can you change the code.
***Sorry, my English is not good enough
This will finally do the trick:
Public Sub Main
Dim a As Inventor.DrawingDocument = ThisDrawing.Document
Dim sht As Inventor.Sheet
Dim shts As Inventor.Sheets
Dim c2 As Integer = 0
For Each sht In a.Sheets
c2=c2+1
Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value
Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value
If c2>0 And c2<9 Then
sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2
ElseIf c2>99 And c2 <999
sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2
ElseIf c2>9 And c2<99
sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2
End If
Next
End Sub
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
@bradeneuropeArthur wrote:This will finally do the trick:
Public Sub Main
Dim a As Inventor.DrawingDocument = ThisDrawing.Document
Dim sht As Inventor.Sheet
Dim shts As Inventor.Sheets
Dim c2 As Integer = 0
For Each sht In a.Sheets
c2=c2+1
Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value
Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value
If c2>0 And c2<9 Then
sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2
ElseIf c2>99 And c2 <999
sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2
ElseIf c2>9 And c2<99
sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2
End If
Next
End Sub
Sheet:9 ?
change to this ?
ElseIf c2>=9 And c2<99
we come closer:
Public Sub Main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value If c2>0 And c2<10 Then sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 ElseIf c2>99 And c2 <1000 sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2 ElseIf c2>9 And c2<100 sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2 End If Next End Sub
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
can you give a (space)-(space) like this " - " without quote between like this c2 & c3
c2 & " - " & c3
sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 ElseIf c2>99 And c2 <1000 sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2 ElseIf c2>9 And c2<100 sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2
Public Sub Main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value If c2>0 And c2<10 Then sht.Name = c1 & " - " & "00" & c2 & " - " & c3 '& ":" & c2 ElseIf c2>99 And c2 <1000 sht.Name = c1 & " - " & "" & c2& " - " & c3 '& ":" & c2 ElseIf c2>9 And c2<100 sht.Name = c1 & " - " & "0" & c2& " - " & c3 '& ":" & c2 End If Next End Sub
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
Public Sub Main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value If c2>0 And c2<10 Then sht.Name = c1 & "-" & "00" & c2 & " - " & c3 '& ":" & c2 ElseIf c2>99 And c2 <1000 sht.Name = c1 & "-" & "" & c2 & " - " & c3 '& ":" & c2 ElseIf c2>9 And c2<100 sht.Name = c1 & "-" & "0" & c2 & " - " & c3 '& ":" & c2 End If Next End Sub
@bradeneuropeArthur wrote:we come closer:
Public Sub Main Dim a As Inventor.DrawingDocument = ThisDrawing.Document Dim sht As Inventor.Sheet Dim shts As Inventor.Sheets Dim c2 As Integer = 0 For Each sht In a.Sheets c2=c2+1 Dim d As Inventor.Document = sht.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim c1 As String = d.PropertySets.Item(3).Item("stock number").Value Dim c3 As String = d.PropertySets.Item(3).Item( "part number").Value If c2>0 And c2<10 Then sht.Name = c1 & "-" & "00" & c2 & c3 '& ":" & c2 ElseIf c2>99 And c2 <1000 sht.Name = c1 & "-" & "" & c2 & c3 '& ":" & c2 ElseIf c2>9 And c2<100 sht.Name = c1 & "-" & "0" & c2 & c3 '& ":" & c2 End If Next End Sub
Based on this code, I changed and added a space between C2 and C3. thanks
sht.Name = c1 & "-" & "00" & c2 & " - " & c3 '& ":" & c2 ElseIf c2>99 And c2 <1000 sht.Name = c1 & "-" & "" & c2 & " - " & c3 '& ":" & c2 ElseIf c2>9 And c2<100 sht.Name = c1 & "-" & "0" & c2 & " - " & c3 '& ":" & c2
Can't find what you're looking for? Ask the community or share your knowledge.