Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JhoelForshav
in reply to: ts2.cad3

Hi @philippe.lagrue 

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