<?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: How can I check the existence of block by command? in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/how-can-i-check-the-existence-of-block-by-command/m-p/12283813#M3254</link>
    <description>&lt;P&gt;Try this........&lt;/P&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;string BLK_TYPE = ""&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;$BLK_TYPE = block.type&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;REAL $X_range = $block.Limits.Xmax - $block.Limits.Xmin&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;REAL $Y_range = $block.Limits.Ymax - $block.Limits.Ymin&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;REAL $Z_range =&amp;nbsp; $block.Limits.Zmax - $block.Limits.Zmin&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;IF ($X_range == 0) {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;IF ($Y_range == 0) {&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;IF ($Z_range == 0) {&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;Message warn "No block exists"&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;} ELSE {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;message info $block.type&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;macro attached below, change .txt to .mac&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 09:14:44 GMT</pubDate>
    <dc:creator>kevin.hammond3WX4X</dc:creator>
    <dc:date>2023-10-04T09:14:44Z</dc:date>
    <item>
      <title>How can I check the existence of block by command?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/how-can-i-check-the-existence-of-block-by-command/m-p/12283711#M3253</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm making a macro program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This function needs a block and if there's no block, the function doesn't work and block form pops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I want to put in a command which checks the existence of block before main commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I couldn't find the command or parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually, I check the type of the block and check its scalar parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if the type is 'box' then check X, Y and Z lengths are larger than 0 or not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I think this way is bizarre and not clean.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is a way to check the existence of block more cleaner, please let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be glad if you reply.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 08:22:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/how-can-i-check-the-existence-of-block-by-command/m-p/12283711#M3253</guid>
      <dc:creator>ikims1126</dc:creator>
      <dc:date>2023-10-04T08:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check the existence of block by command?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/how-can-i-check-the-existence-of-block-by-command/m-p/12283813#M3254</link>
      <description>&lt;P&gt;Try this........&lt;/P&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;string BLK_TYPE = ""&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;$BLK_TYPE = block.type&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;REAL $X_range = $block.Limits.Xmax - $block.Limits.Xmin&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;REAL $Y_range = $block.Limits.Ymax - $block.Limits.Ymin&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;REAL $Z_range =&amp;nbsp; $block.Limits.Zmax - $block.Limits.Zmin&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;IF ($X_range == 0) {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;IF ($Y_range == 0) {&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;IF ($Z_range == 0) {&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;Message warn "No block exists"&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;} ELSE {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;message info $block.type&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;macro attached below, change .txt to .mac&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 09:14:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/how-can-i-check-the-existence-of-block-by-command/m-p/12283813#M3254</guid>
      <dc:creator>kevin.hammond3WX4X</dc:creator>
      <dc:date>2023-10-04T09:14:44Z</dc:date>
    </item>
  </channel>
</rss>

