Rename browser node for component pattern

Rename browser node for component pattern

bhavik4244
Collaborator Collaborator
578 Views
3 Replies
Message 1 of 4

Rename browser node for component pattern

bhavik4244
Collaborator
Collaborator

Hi there,

 

I need to rename browser node for component pattern, first parent part will be manully changed browser name but for later ones I need auto renaming of browser name accoding to the numbering sequencing. You can find it how I need in below snap.

 

pattern can varies from 3 or 4 or 5. I have attached the Inventor files also.

 

bhavik4244_0-1630920804288.png

thanks a lot!


Bhavik Suthar
0 Likes
Accepted solutions (1)
579 Views
3 Replies
Replies (3)
Message 2 of 4

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @bhavik4244 

Running this iLogic rule in your attached assembly will give you the result you want according to your picture 🙂

Dim oAsm As AssemblyDocument = ThisDoc.Document
Dim oPattern As OccurrencePattern = oAsm.ComponentDefinition.OccurrencePatterns(1)
For i = 1 To oPattern.OccurrencePatternElements.Count
	Dim n As Integer = 1
	For Each oOcc As ComponentOccurrence In oPattern.OccurrencePatternElements(i).Occurrences
		oOcc.Name = i & n.ToString("00")
		n += 1
	Next
Next
Message 3 of 4

bhavik4244
Collaborator
Collaborator

@JhoelForshav 

 

Thank you so much, this what I exactly want 😊


Bhavik Suthar
Message 4 of 4

bhavik4244
Collaborator
Collaborator

@JhoelForshav 

I need your help Jhoel, I need to change second letter from right which is 1. It can be 2,3,4 or 5. other need to be constant.

 

Thank again.

 

bhavik4244_1-1631859966694.png

 

 

 

 


Bhavik Suthar
0 Likes