Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
r.claus
289 Views, 2 Replies

iLogic - Rename workpoints in patterns

Hello,

I try to rename workpoints within a rectangular pattern (see picture). This pattern or collection is created with a another collection of workpoints.

My problem is that the code only change the names of the first workpoints in each element.
Is there a way to change all the names?

 

'Set the document
Dim oDoc As PartDocument
oDoc = ThisDoc.Document

'Set the component definition
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition

'Set the circular pattern features collection

Dim oCircularPatternFeature As CircularPatternFeature
oCircularPatternFeature = oCompDef.Features.CircularPatternFeatures.Item("PointPattern")

 Dim oElement As FeaturePatternElement
 
 	For Each oElement In oCircularPatternFeature.PatternElements
		If oElement.Index = 1 Then
			'do nothing
		Else
			Dim oworkpoint As WorkPoint
			oworkpoint = oElement.ResultFeatures.Item(1)
			oworkpoint.Name = "TestPoint" & oElement.Index
		End If
	Next 
ThisDoc.Document.Update