<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: iLogic - Rename workpoints in patterns in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806280#M132159</link>
    <description>&lt;P&gt;I am not sure if I understand your idea, but please try if this code works.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'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

Dim i As Integer
Dim k As Integer = 1
 	For Each oElement In oCircularPatternFeature.PatternElements
		If oElement.Index = 1 Then
			'do nothing
		Else
				For i = 1 To oElement.ResultFeatures.count
			Dim oworkpoint As WorkPoint
			oworkpoint = oElement.ResultFeatures.Item(i)
			oworkpoint.Name = "TestPoint" &amp;amp; k
			k=k+1
				Next
		End If
	Next 
ThisDoc.Document.Update&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 07 Dec 2021 13:59:15 GMT</pubDate>
    <dc:creator>TomaszDąbrowski</dc:creator>
    <dc:date>2021-12-07T13:59:15Z</dc:date>
    <item>
      <title>iLogic - Rename workpoints in patterns</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806205#M132157</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I try to rename workpoints within a rectangular pattern (see picture). This pattern or collection is created with a another collection of workpoints.&lt;BR /&gt;&lt;BR /&gt;My problem is that the code only change the names of the first workpoints in each element.&lt;BR /&gt;Is there a way to change all the names?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #808080;"&gt;'Set the document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Set the component definition&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oCompDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Set the circular pattern features collection&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCircularPatternFeature&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;CircularPatternFeature&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oCircularPatternFeature&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Features&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CircularPatternFeatures&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"PointPattern"&lt;/SPAN&gt;)

 &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oElement&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;FeaturePatternElement&lt;/SPAN&gt;
 
 	&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oElement&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCircularPatternFeature&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PatternElements&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oElement&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Index&lt;/SPAN&gt; = 1 &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
			&lt;SPAN style="color: #808080;"&gt;'do nothing&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oworkpoint&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;WorkPoint&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oworkpoint&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oElement&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ResultFeatures&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(1)
			&lt;SPAN style="color: #800000;"&gt;oworkpoint&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"TestPoint"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oElement&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Index&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt; 
&lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Update&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 13:38:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806205#M132157</guid>
      <dc:creator>r.claus</dc:creator>
      <dc:date>2021-12-07T13:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic - Rename workpoints in patterns</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806280#M132159</link>
      <description>&lt;P&gt;I am not sure if I understand your idea, but please try if this code works.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'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

Dim i As Integer
Dim k As Integer = 1
 	For Each oElement In oCircularPatternFeature.PatternElements
		If oElement.Index = 1 Then
			'do nothing
		Else
				For i = 1 To oElement.ResultFeatures.count
			Dim oworkpoint As WorkPoint
			oworkpoint = oElement.ResultFeatures.Item(i)
			oworkpoint.Name = "TestPoint" &amp;amp; k
			k=k+1
				Next
		End If
	Next 
ThisDoc.Document.Update&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Dec 2021 13:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806280#M132159</guid>
      <dc:creator>TomaszDąbrowski</dc:creator>
      <dc:date>2021-12-07T13:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic - Rename workpoints in patterns</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806307#M132161</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;thanks for your fast help.&lt;BR /&gt;I had forgotten that I have rectangular patterns but I just change this and your code works.&lt;BR /&gt;&lt;BR /&gt;Thank you very much &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;</description>
      <pubDate>Tue, 07 Dec 2021 14:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rename-workpoints-in-patterns/m-p/10806307#M132161</guid>
      <dc:creator>r.claus</dc:creator>
      <dc:date>2021-12-07T14:11:09Z</dc:date>
    </item>
  </channel>
</rss>

