<?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] Selected hole position variable? in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8138689#M20662</link>
    <description>&lt;P&gt;Koodos for solving the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was actually searching for an answer of how to acquire the X position value of a selected feature in a specific featureset. My feature set is called "TOOLING BALLS"&lt;/P&gt;&lt;P&gt;It seems that this value, according to your solution is kept in:&amp;nbsp;&lt;/P&gt;&lt;P&gt;'WPPoint[0]'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'd like to do is assign the X position value of a selected hole of a featureset to a Real Variable&lt;/P&gt;&lt;P&gt;For instance I will have the following line:&lt;/P&gt;&lt;P&gt;REAL HolePosX = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I want to assign the X position value of the selected hole to the variable HolePosX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;$HolePosX = (extract($components(entity('featureset','TOOLING BALLS')),'WPPoint[0]'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, nothing gets assigned to my variable....probably because my command is missing information regarding the actual selected hole.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jul 2018 15:38:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-07-18T15:38:17Z</dc:date>
    <item>
      <title>[MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8108646#M20656</link>
      <description>&lt;P&gt;I'm looking to create a macro that will grab each manually selected hole feature and extract the x/y/z coordinates of the top of each individual hole. I'm running into two problems&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I can only make the "FOREACH" selection of the macro work for holes that are selected through the explorer tree. Id like to be able to just select the holes as they're presented on the screen&lt;/P&gt;&lt;P&gt;2. I can't figure out the variable to use to extract the x/y/z location.&lt;/P&gt;&lt;PRE&gt;REAL XPOS = ''
REAL YPOS = ''
REAL ZPOS = ''
 
 
 FOREACH $Selected_Hole IN (explorer_selected_entities()) {
IF $Selected_Hole.RootType != "hole" {
MESSAGE INFO "NO HOLES SELECTED"
BREAK
}
// HERE IS WHERE I WOULD LIKE TO EXTRACT THE HOLE LOCATIONS AND UPDATE THE VARIABLES LISTED ABOVE AND USE&lt;BR /&gt;// THEM TO TRANSFORM A MODEL


}&lt;/PRE&gt;&lt;P&gt;Any ideas peeps? Once it's up and running properly I'll be happy to post it in it's complete form to the tips and tricks section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 07:35:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8108646#M20656</guid>
      <dc:creator>danmic7JH66</dc:creator>
      <dc:date>2018-07-04T07:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8108787#M20657</link>
      <description>&lt;P&gt;Look at:&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/powermill-forum/getting-data-from-hole-feature-set/m-p/8096350" target="_blank"&gt;https://forums.autodesk.com/t5/powermill-forum/getting-data-from-hole-feature-set/m-p/8096350&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;rafael.sansao&lt;/STRONG&gt; has this&amp;nbsp;Solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;To view all available parameters:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PRINT PAR $components(entity('featureset',''))&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I do not know what format you want from this list.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;But this should serve as the starting point:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;REAL LIST WP_X = extract($components(entity('featureset','')),'WPPoint[0]')
REAL LIST WP_Y = extract($components(entity('featureset','')),'WPPoint[1]')

INT $index = 0
WHILE $index &amp;lt; SIZE(WP_X) {
	STRING TEXT = WP_X[$index] + ';' + WP_Y[$index]
	PRINT $TEXT
	$index = $index + 1
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 08:41:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8108787#M20657</guid>
      <dc:creator>LasseFred</dc:creator>
      <dc:date>2018-07-04T08:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8108950#M20658</link>
      <description>&lt;P&gt;That's a great starting point but do you know by chance how to have it extract the points of selected holes only?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 09:55:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8108950#M20658</guid>
      <dc:creator>danmic7JH66</dc:creator>
      <dc:date>2018-07-04T09:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8109148#M20659</link>
      <description>&lt;P&gt;A quick way to do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;COPY FEATURESET ; SELECTED
RENAME Featureset # "feature_XYZ"
ACTIVATE Featureset "feature_XYZ"

REAL LIST WP_X = extract($components(entity('featureset','')),'WPPoint[0]')
REAL LIST WP_Y = extract($components(entity('featureset','')),'WPPoint[1]')
REAL LIST WP_z = extract($components(entity('featureset','')),'WPPoint[2]')

INT $index = 0
WHILE $index &amp;lt; SIZE(WP_X) {
	STRING TEXT = WP_X[$index] + ';' + WP_Y[$index] + ';' + WP_Z[$index]
	PRINT $TEXT
	$index = $index + 1
}

DELETE FEATURESET "feature_XYZ"&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jul 2018 11:33:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8109148#M20659</guid>
      <dc:creator>LasseFred</dc:creator>
      <dc:date>2018-07-04T11:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8110597#M20660</link>
      <description>&lt;P&gt;That is one hundred percent perfect, thank you so much. I don't know why I didn't think to just copy the selected features into a new featureset before. Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 08:02:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8110597#M20660</guid>
      <dc:creator>danmic7JH66</dc:creator>
      <dc:date>2018-07-05T08:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8110674#M20661</link>
      <description>&lt;P&gt;I'm glad I could help.&lt;/P&gt;&lt;P&gt;sometimes i also have a tendency to make things harder than they are.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 08:27:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8110674#M20661</guid>
      <dc:creator>LasseFred</dc:creator>
      <dc:date>2018-07-05T08:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8138689#M20662</link>
      <description>&lt;P&gt;Koodos for solving the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was actually searching for an answer of how to acquire the X position value of a selected feature in a specific featureset. My feature set is called "TOOLING BALLS"&lt;/P&gt;&lt;P&gt;It seems that this value, according to your solution is kept in:&amp;nbsp;&lt;/P&gt;&lt;P&gt;'WPPoint[0]'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'd like to do is assign the X position value of a selected hole of a featureset to a Real Variable&lt;/P&gt;&lt;P&gt;For instance I will have the following line:&lt;/P&gt;&lt;P&gt;REAL HolePosX = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I want to assign the X position value of the selected hole to the variable HolePosX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;$HolePosX = (extract($components(entity('featureset','TOOLING BALLS')),'WPPoint[0]'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, nothing gets assigned to my variable....probably because my command is missing information regarding the actual selected hole.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 15:38:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8138689#M20662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-18T15:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Selected hole position variable?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8140895#M20663</link>
      <description>&lt;P&gt;This thread appears to be dead because the problem was solved.&lt;/P&gt;&lt;P&gt;So I created a new thread more specific to what I'd like to accomplish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 10:29:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-selected-hole-position-variable/m-p/8140895#M20663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-19T10:29:57Z</dc:date>
    </item>
  </channel>
</rss>

