06-30-2023
05:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-30-2023
05:27 AM
It seems like something like this should be enough to accomplish what you're trying to do?
Dim name As String = "Part"
Dim num As Integer = 1
Dim def As AssemblyComponentDefinition = ThisDoc.Document.ComponentDefinition
For Each oOcc As ComponentOccurrence In def.Occurrences.AllReferencedOccurrences(def)
Try
oOcc.Name = name & num
num += 1
Catch
MsgBox("couldn't rename " & oOcc.Name)
End Try
Next
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website