I don't think there is a fast way to do this using the browser. But I think that you can do this fast with an occurrence search function. something like this:
Sub Main()
Dim doc As AssemblyDocument = ThisDoc.Document
Dim occs As IEnumerable(Of ComponentOccurrence) = findAllWhere(doc,
Function(occ)
'Contains' is case sensitive
Return occ.Name.Contains("void-vectratest-UB3_4PA_003")
End Function)
Dim i = 1
For Each occ As ComponentOccurrence In occs
occ.Name = "test" & i
i = i + 1
Next
End Sub
Public Function findAllWhere(doc As AssemblyDocument,
predicate As Func(Of ComponentOccurrence, Boolean)) As IEnumerable(Of ComponentOccurrence)
Dim list As IEnumerable(Of ComponentOccurrence) = doc.ComponentDefinition.
Occurrences.Cast(Of ComponentOccurrence).
Where(predicate)
Dim assemblyList As IEnumerable(Of ComponentOccurrence) = doc.ComponentDefinition.
Occurrences.Cast(Of ComponentOccurrence).
Where(Function(o) o.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject)
For Each assOcc As ComponentOccurrence In assemblyList
If TypeOf assOcc.Definition Is VirtualComponentDefinition Then Continue For
Dim assDoc As AssemblyDocument = assOcc.ReferencedDocumentDescriptor.ReferencedDocument
Dim listToAdd As IEnumerable(Of ComponentOccurrence) = findAllWhere(assDoc, predicate)
list = list.Concat(listToAdd)
Next
Return list
End Function
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog: hjalte.nl - github.com