<?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: Macro Help - Foreach segment in a pattern in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10538777#M25209</link>
    <description>&lt;P&gt;Actually, I needed that one too. I just figured that would be harder to find. Thank you a whole lot man. It works perfect.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 23:42:49 GMT</pubDate>
    <dc:creator>robert.reedHH7Q9</dc:creator>
    <dc:date>2021-08-11T23:42:49Z</dc:date>
    <item>
      <title>Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/7463178#M25200</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to achieve a foreach loop for segments within a pattern? I am trying to analyze each segment inside one of my patterns and remove the segment if it doesn't meet my criteria.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance for any assistance&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 13:21:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/7463178#M25200</guid>
      <dc:creator>jake.montgomery</dc:creator>
      <dc:date>2017-10-16T13:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/7463182#M25201</link>
      <description>&lt;P&gt;&lt;A href="https://manufacturing.autodesk.com/forums/forum.delcam.com/viewtopicf887-2.html?f=8&amp;amp;t=11185" target="_blank"&gt;See this&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 13:22:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/7463182#M25201</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-10-16T13:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/7463208#M25202</link>
      <description>&lt;P&gt;Thank you very much! That will work perfectly&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 13:29:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/7463208#M25202</guid>
      <dc:creator>jake.montgomery</dc:creator>
      <dc:date>2017-10-16T13:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10532412#M25203</link>
      <description>&lt;P&gt;Is there an updated version of this link? I'm trying to do a similar task and believe this might help me out.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 21:15:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10532412#M25203</guid>
      <dc:creator>robert.reedHH7Q9</dc:creator>
      <dc:date>2021-08-09T21:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10533177#M25204</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not remember what was under the link, but please write what is Your goal.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 06:13:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10533177#M25204</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2021-08-10T06:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10533863#M25205</link>
      <description>&lt;P&gt;This isn't exactly what you were asking for, but here is a macro that I wrote for someone wanting to analyze a pattern to find the smallest rad.&amp;nbsp; You may be able to take some of the logic here and re-purpose it:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ENTITY $pat = INPUT ENTITY PATTERN "Select the Pattern to Analyze"
DIALOGS MESSAGE OFF
EDIT PATTERN $pat.Name SELECT ALL
EDIT PATTERN $pat.Name SPLIT

INT $Segments = segments($pat)

INT $counter = 0
REAL $rad = 0
EDIT PATTERN $pat.Name CURVEEDITOR START
REAL $SmallestArc = 9999999

WHILE $counter &amp;lt; $Segments {
	
	EDIT PATTERN $pat.Name DESELECT ALL	
	CURVEEDITOR MODE DEFAULT CURVEEDITOR SELECT SINGLE_SEGMENT $counter CURVEEDITOR ARC_EDIT MODIFY
	REAL $arc = 0
	$arc = $widget("CEArcEditor.Dimension").value
	IF $arc != 0 AND $arc &amp;lt; $SmallestArc {
		$SmallestArc = $arc
		}
	
	$counter = $counter +1
	}
CURVEEDITOR FINISH ACCEPT

EDIT PATTERN $pat.Name SELECT ALL
EDIT PATTERN $pat.Name MERGE
DIALOGS MESSAGE ON

STRING $msg = "Smallest radius = " + $SmallestArc
MESSAGE INFO $msg&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Aug 2021 11:53:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10533863#M25205</guid>
      <dc:creator>cfastNJWK6</dc:creator>
      <dc:date>2021-08-10T11:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10536063#M25206</link>
      <description>&lt;P&gt;I was trying to get the longest line in a pattern. I was able to piece something together to accomplish that. You post some very impressive code though, so I would still be interested if you have something for that purpose.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 04:11:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10536063#M25206</guid>
      <dc:creator>robert.reedHH7Q9</dc:creator>
      <dc:date>2021-08-11T04:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10536659#M25207</link>
      <description>&lt;P&gt;May the newer Pmills have easier way, but try this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EDIT PATTERN ; DESELECT ALL
EDIT BLOCK LIMITTYPE PATTERN
EDIT BLOCK RESETLIMIT "10"
EDIT BLOCK RESET
CREATE TOOL ; BALLNOSED
COMMIT PATTERN ;

ENTITY tp = ENTITY('toolpath','')
INT i = 0
REAL LIST segLenLst = {}

DO {
	INT k = add_last($segLenLst, segment_get_length( $tp, $i))
	$i = $i + 1
} WHILE $i &amp;lt; toolpath_component_count($tp, 'segments' )

DELETE TOOLPATH ;
DELETE TOOL ;
REAL lim = MAX($segLenLst)-0.01
EDIT PATTERN ; SELECT LENGTH LT $lim  
EDIT PATTERN ; SELECT INVERT
MESSAGE INFO STRING(MAX($segLenLst))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 08:59:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10536659#M25207</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2021-08-11T08:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10538260#M25208</link>
      <description>&lt;P&gt;I'll give that one a shot. This is what I ended up with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CREATE PATTERN ;&lt;BR /&gt;RENAME PATTERN # "PROFILE_BOUNDARY"&lt;BR /&gt;EDIT PATTERN "PROFILE_BOUNDARY" INSERT BOUNDARY ;&lt;BR /&gt;DEACTIVATE Boundary&lt;/P&gt;&lt;P&gt;REAL $ProfileLength = 0.0&lt;BR /&gt;INT $Rows = segments(entity('pattern', ''))&lt;BR /&gt;if ($Rows &amp;gt; 1) {&lt;BR /&gt;EDIT PATTERN "PROFILE_BOUNDARY" CURVEEDITOR START&lt;BR /&gt;CURVEEDITOR MODE REORDER&lt;BR /&gt;INT $Row = 0&lt;BR /&gt;WHILE $Row &amp;lt; $Rows {&lt;BR /&gt;STRING $SegLengthStr = list_cell_value('CEReorderSegments.CEListView',$Row,3)&lt;BR /&gt;REAL $SegLength = $SegLengthStr&lt;BR /&gt;IF ($Seglength &amp;gt; $ProfileLength) {&lt;BR /&gt;$ProfileLength = $Seglength&lt;BR /&gt;}&lt;BR /&gt;$Row = ($Row + 1)&lt;BR /&gt;}&lt;BR /&gt;CURVEEDITOR MODE DEFAULT&lt;BR /&gt;CURVEEDITOR FINISH ACCEPT&lt;BR /&gt;$ProfileLength = ($ProfileLength-.01)&lt;BR /&gt;EDIT PATTERN "PROFILE_BOUNDARY" SELECT LENGTH LT&lt;BR /&gt;$ProfileLength&lt;BR /&gt;DELETE PATTERN "PROFILE_BOUNDARY" SELECTED&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 19:10:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10538260#M25208</guid>
      <dc:creator>robert.reedHH7Q9</dc:creator>
      <dc:date>2021-08-11T19:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Help - Foreach segment in a pattern</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10538777#M25209</link>
      <description>&lt;P&gt;Actually, I needed that one too. I just figured that would be harder to find. Thank you a whole lot man. It works perfect.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 23:42:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-foreach-segment-in-a-pattern/m-p/10538777#M25209</guid>
      <dc:creator>robert.reedHH7Q9</dc:creator>
      <dc:date>2021-08-11T23:42:49Z</dc:date>
    </item>
  </channel>
</rss>

