<?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 Macro WHILE query not working when using 'OR' in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548179#M2322</link>
    <description>&lt;P&gt;I am trying to do a check in my macro that either a radius tool or end mill is selected but I only seem to be able to get it to work when querying one of the two things but when I want it to query both of these things it doesn't seem to work as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code that doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "tip_radiused") OR ($Tooltypes == "end_mill") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also code that doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "tip_radiused") OR NOT ($Tooltypes == "end_mill") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code that does work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "tip_radiused") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also code that works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "end_mill") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone can let me know how to fix this or an alternative way of doing this it would be much appreciated.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2024 10:53:54 GMT</pubDate>
    <dc:creator>siwalker</dc:creator>
    <dc:date>2024-02-08T10:53:54Z</dc:date>
    <item>
      <title>Macro WHILE query not working when using 'OR'</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548179#M2322</link>
      <description>&lt;P&gt;I am trying to do a check in my macro that either a radius tool or end mill is selected but I only seem to be able to get it to work when querying one of the two things but when I want it to query both of these things it doesn't seem to work as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code that doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "tip_radiused") OR ($Tooltypes == "end_mill") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also code that doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "tip_radiused") OR NOT ($Tooltypes == "end_mill") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code that does work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "tip_radiused") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also code that works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT ($Tooltypes == "end_mill") {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone can let me know how to fix this or an alternative way of doing this it would be much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 10:53:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548179#M2322</guid>
      <dc:creator>siwalker</dc:creator>
      <dc:date>2024-02-08T10:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macro WHILE query not working when using 'OR'</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548269#M2323</link>
      <description>&lt;LI-CODE lang="cpp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE NOT (($Tooltypes == "tip_radiused") OR ($Tooltypes == "end_mill")) {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;STRING $Tooltypes = entity('tool','').type

WHILE $Tooltypes != "tip_radiused" AND $Tooltypes != "end_mill" {
MESSAGE ERROR 'Wrong tool type selected'
MACRO PAUSE "Please activate suitable slot drill" +CRLF+ "for predrill machining"
$Tooltypes = entity('tool','').type
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Feb 2024 11:43:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548269#M2323</guid>
      <dc:creator>ondrej.mikulec</dc:creator>
      <dc:date>2024-02-08T11:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro WHILE query not working when using 'OR'</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548302#M2324</link>
      <description>&lt;P&gt;Thanks. I thought I was missing something simple. Looks like I just needed some additional brackets.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 14:11:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-while-query-not-working-when-using-or/m-p/12548302#M2324</guid>
      <dc:creator>siwalker</dc:creator>
      <dc:date>2024-02-08T14:11:24Z</dc:date>
    </item>
  </channel>
</rss>

