Hi @bhavik4244
Sorry, I just saw that you requested something else in your previous thread, is that still something you need help with?
I didn't really understand that well how you wanted it to work...
For this question though, I think something like this should do the trick? 🙂
Dim oAsm As AssemblyDocument = ThisDoc.Document
Dim oPattern As OccurrencePattern = oAsm.ComponentDefinition.OccurrencePatterns(1)
Dim oAlphabet As String() = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", _
"L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }
For i = 1 To oPattern.OccurrencePatternElements.Count
Dim n As Integer = 1
For Each oOcc As ComponentOccurrence In oPattern.OccurrencePatternElements(i).Occurrences
oOcc.Name = oAlphabet(n - 1) & i & n.ToString("00")
n += 1
Next
Next