<?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: Check if a work plane is exist. in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10923146#M6972</link>
    <description>&lt;P&gt;STRING $wp = ""&lt;BR /&gt;IF entity_exists(Workplane) {&lt;BR /&gt;$wp = $Workplane.Name&lt;BR /&gt;} ELSE {&lt;BR /&gt;MESSAGE INFO "Please activate a Workplane and try again"&lt;BR /&gt;MACRO ABORT&lt;BR /&gt;}&lt;BR /&gt;REAL $vector = entity('Workplane', $wp).ZAxis[0]&lt;BR /&gt;REAL $vector1 = entity('Workplane', $wp).ZAxis[1]&lt;BR /&gt;REAL $vector2 = entity('Workplane', $wp).ZAxis[2]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;STRING LIST $WorkPlanes = {}&lt;/P&gt;&lt;P&gt;FOREACH $w IN folder('Workplane') {&lt;BR /&gt;IF $w.Name != $wp {&lt;BR /&gt;REAL $vec = $w.ZAxis[0]&lt;BR /&gt;REAL $vec1 = $w.ZAxis[1]&lt;BR /&gt;REAL $vec2 = $w.ZAxis[2]&lt;BR /&gt;IF $vec == $vector and $vec1 == $vector1 and $vec2 == $vector2 {&lt;BR /&gt;int b = add_last($WorkPlanes, $w.Name)&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;IF is_empty($WorkPlanes) {&lt;BR /&gt;MESSAGE INFO "No other workplanes with the same Z vector"&lt;BR /&gt;MACRO ABORT&lt;BR /&gt;} ELSE {&lt;BR /&gt;INT $ActivateWP = INPUT CHOICE $WorkPlanes "These workplanes have the same Z vector. Select one to activate"&lt;BR /&gt;STRING $newWP = $WorkPlanes[$ActivateWP]&lt;BR /&gt;ACTIVATE WORKPLANE $newWP&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed your program a little bit and it works good so far. Thank you for your help!&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 12:01:41 GMT</pubDate>
    <dc:creator>peterquRXR7S</dc:creator>
    <dc:date>2022-02-02T12:01:41Z</dc:date>
    <item>
      <title>Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910360#M6960</link>
      <description>&lt;P&gt;I need a help. When I use macro to drill a hole, I don't want to make lots of work planes. I want to know if the work plane exists already. If I have this work plane already, activate it.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 12:58:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910360#M6960</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-27T12:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910394#M6961</link>
      <description>&lt;P&gt;What do you mean?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;That a particularly named workplane exists?&lt;/LI&gt;&lt;LI&gt;That the Workplane parameter has been activated?&lt;/LI&gt;&lt;LI&gt;That a workplane wioth a specific orientation exists?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:16:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910394#M6961</guid>
      <dc:creator>urizenYHS3W</dc:creator>
      <dc:date>2022-01-27T13:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910525#M6962</link>
      <description>&lt;P&gt;If you right click on the featureset and click "Activate Workplane", PowerMILL will activate the workplane that was created when the hole featureset was created.&lt;/P&gt;&lt;P&gt;Macro command to activate the workplane for the active featureset would be:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ACTIVATE WORKPLANE FROMENTITY FEATURESET ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:59:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910525#M6962</guid>
      <dc:creator>cfastNJWK6</dc:creator>
      <dc:date>2022-01-27T13:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910626#M6963</link>
      <description>&lt;P&gt;Thank you for replying. I mean I have many work planes already. One of these work planes( "Datum_A) is the same direction with the hole. I want to use Datum_A drill this hole. I don't want to activate the feature set work plane. Other wise, I will have too many work planes.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:31:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910626#M6963</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-27T14:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910681#M6964</link>
      <description>&lt;OL&gt;&lt;LI&gt;That a particularly named workplane exists?&lt;/LI&gt;&lt;LI&gt;That the Workplane parameter has been activated?&lt;/LI&gt;&lt;LI&gt;That a workplane wioth a specific orientation exists?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The work plane may not exist. The X,Y orientation is not important. Just the same Z axis direction is OK. For example, When I drill a hole, I will search if there is a work plane has the same Z axis. If it is true, then use this work plane. If false,&amp;nbsp; activate the feature set work plane.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:46:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910681#M6964</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-27T14:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910708#M6965</link>
      <description>&lt;P&gt;So you are looking for a macro that will activate an already existing workplane, that is aligned with an active featureset?&amp;nbsp; If there is no workplane in the project, create one aligned to the hole?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:51:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910708#M6965</guid>
      <dc:creator>cfastNJWK6</dc:creator>
      <dc:date>2022-01-27T14:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910760#M6966</link>
      <description>&lt;P&gt;Yes. But I don't have to create one. Powermill creates a work plane for each feature set automatically. I just activate it.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:09:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910760#M6966</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-27T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910780#M6967</link>
      <description>&lt;P&gt;So...&lt;/P&gt;&lt;P&gt;You just want a macro that will check if there are any other workplanes in the project with the same Z vector as the active workplane?&amp;nbsp; If there are, present a list for you to select which workplane you would like to use?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:14:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10910780#M6967</guid>
      <dc:creator>cfastNJWK6</dc:creator>
      <dc:date>2022-01-27T15:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10911257#M6968</link>
      <description>&lt;P&gt;Yes. If there is one only, I can use it directly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 17:49:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10911257#M6968</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-27T17:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10911489#M6969</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;STRING $wp = ""
IF entity_exists(Workplane) {
	$wp = $Workplane.Name
	} ELSE {
	MESSAGE INFO "Please activate a Workplane and try again"
	MACRO ABORT
	}
REAL $vector = entity('Workplane', $wp).ZAxis[2]
STRING LIST $WorkPlanes = {}

FOREACH $w IN folder('Workplane') {
	IF $w.Name != $wp  {
		REAL $vec = $w.ZAxis[2]
		IF $vec == $vector {
			int b = add_last($WorkPlanes, $w.Name)
			}
		}
	
	}

IF is_empty($WorkPlanes) {
	MESSAGE INFO "No other workplanes with the same Z vector"
	MACRO ABORT
	} ELSE {
	INT $ActivateWP = INPUT CHOICE $WorkPlanes "These workplanes have the same Z vector. Select one to activate"
	STRING $newWP = $WorkPlanes[$ActivateWP]
	ACTIVATE WORKPLANE $newWP
	}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Jan 2022 19:13:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10911489#M6969</guid>
      <dc:creator>cfastNJWK6</dc:creator>
      <dc:date>2022-01-27T19:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10914522#M6970</link>
      <description>&lt;P&gt;Thank you so much! I will test it later.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 21:41:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10914522#M6970</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-28T21:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10918146#M6971</link>
      <description>&lt;P&gt;I tested it. Sometimes it doesn't work. The feature set has an angle, It still ask me choose an other work plane, which is a straight work plane.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 12:37:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10918146#M6971</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-01-31T12:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Check if a work plane is exist.</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10923146#M6972</link>
      <description>&lt;P&gt;STRING $wp = ""&lt;BR /&gt;IF entity_exists(Workplane) {&lt;BR /&gt;$wp = $Workplane.Name&lt;BR /&gt;} ELSE {&lt;BR /&gt;MESSAGE INFO "Please activate a Workplane and try again"&lt;BR /&gt;MACRO ABORT&lt;BR /&gt;}&lt;BR /&gt;REAL $vector = entity('Workplane', $wp).ZAxis[0]&lt;BR /&gt;REAL $vector1 = entity('Workplane', $wp).ZAxis[1]&lt;BR /&gt;REAL $vector2 = entity('Workplane', $wp).ZAxis[2]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;STRING LIST $WorkPlanes = {}&lt;/P&gt;&lt;P&gt;FOREACH $w IN folder('Workplane') {&lt;BR /&gt;IF $w.Name != $wp {&lt;BR /&gt;REAL $vec = $w.ZAxis[0]&lt;BR /&gt;REAL $vec1 = $w.ZAxis[1]&lt;BR /&gt;REAL $vec2 = $w.ZAxis[2]&lt;BR /&gt;IF $vec == $vector and $vec1 == $vector1 and $vec2 == $vector2 {&lt;BR /&gt;int b = add_last($WorkPlanes, $w.Name)&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;IF is_empty($WorkPlanes) {&lt;BR /&gt;MESSAGE INFO "No other workplanes with the same Z vector"&lt;BR /&gt;MACRO ABORT&lt;BR /&gt;} ELSE {&lt;BR /&gt;INT $ActivateWP = INPUT CHOICE $WorkPlanes "These workplanes have the same Z vector. Select one to activate"&lt;BR /&gt;STRING $newWP = $WorkPlanes[$ActivateWP]&lt;BR /&gt;ACTIVATE WORKPLANE $newWP&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed your program a little bit and it works good so far. Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 12:01:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/check-if-a-work-plane-is-exist/m-p/10923146#M6972</guid>
      <dc:creator>peterquRXR7S</dc:creator>
      <dc:date>2022-02-02T12:01:41Z</dc:date>
    </item>
  </channel>
</rss>

