<?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 Betreff: Boolean function in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851776#M1633</link>
    <description>&lt;P&gt;Can you tell us in detail what your goal is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;heres an example of a function that returns a boolean value:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;function main() {
	
	bool $yourBool = 0
	
	call yourFunction($yourBool)

	if $yourBool {
		message info "True"
	} else {
		message info "False"
	}
}

function yourFunction(output bool $b) {
	$b = 1
}&lt;/LI-CODE&gt;&lt;P&gt;when you call yourFunction in the main method the value gets changed to true.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 14:50:26 GMT</pubDate>
    <dc:creator>icse</dc:creator>
    <dc:date>2024-06-20T14:50:26Z</dc:date>
    <item>
      <title>Boolean function</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851511#M1631</link>
      <description>&lt;P&gt;Hello. I need to write a function that returns a boolean value, which I can then use in an IF statement. I'm not entirely sure how to implement this correctly.&lt;BR /&gt;Could someone please provide an example of how this can be done? Any help or guidance would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:57:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851511#M1631</guid>
      <dc:creator>PK_0</dc:creator>
      <dc:date>2024-06-20T12:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean function</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851636#M1632</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;here's a quick example. what are you looking to return?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;bool&lt;/SPAN&gt;&lt;SPAN&gt; b = $toolpath.ZRange.Maximum.Active&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;// if the status is false pop message box &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// (to check if true use '1')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; b == &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MESSAGE INFO&lt;/SPAN&gt; &lt;SPAN&gt;"No"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Jun 2024 13:47:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851636#M1632</guid>
      <dc:creator>TK.421</dc:creator>
      <dc:date>2024-06-20T13:47:49Z</dc:date>
    </item>
    <item>
      <title>Betreff: Boolean function</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851776#M1633</link>
      <description>&lt;P&gt;Can you tell us in detail what your goal is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;heres an example of a function that returns a boolean value:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;function main() {
	
	bool $yourBool = 0
	
	call yourFunction($yourBool)

	if $yourBool {
		message info "True"
	} else {
		message info "False"
	}
}

function yourFunction(output bool $b) {
	$b = 1
}&lt;/LI-CODE&gt;&lt;P&gt;when you call yourFunction in the main method the value gets changed to true.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 14:50:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12851776#M1633</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-06-20T14:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean function</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12853001#M1634</link>
      <description>&lt;P&gt;What would be macro alternative to this python code?:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def is_even(number):&lt;BR /&gt;if number % 2 == 0:&lt;BR /&gt;return True&lt;BR /&gt;else:&lt;BR /&gt;return False&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;number_to_check = 4&lt;/P&gt;&lt;P&gt;if is_even(number_to_check):&lt;BR /&gt;print("even")&lt;BR /&gt;else:&lt;BR /&gt;print("odd")&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 05:50:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12853001#M1634</guid>
      <dc:creator>PK_0</dc:creator>
      <dc:date>2024-06-21T05:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean function</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12853454#M1635</link>
      <description>&lt;P&gt;i cant test it atm but it should look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;function is_even(int $number, output bool $result) {
	if ($number % 2) == 0 {
		$result = True
	} else {
		$result = False
	}
}

function main() {
	int $number_to_check = 4
	
	bool $even = 0
	Call is_even($number_to_check,$even)
	
	if $even {
		message info "Even"
	} else {
		message info "Odd"
	}
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 21 Jun 2024 11:20:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/boolean-function/m-p/12853454#M1635</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-06-21T11:20:56Z</dc:date>
    </item>
  </channel>
</rss>

