<?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: Problem when using conditions in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090240#M3797</link>
    <description>&lt;P&gt;I more item to check....&lt;/P&gt;&lt;P&gt;Is the macro being run from from a trusted files or trusted directory, i have seen macros questioned from time to time usually if they are stored on a network drive. check options as below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kevinhammond3WX4X_0-1688969415929.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238323i683E03C71E8D9466/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kevinhammond3WX4X_0-1688969415929.png" alt="kevinhammond3WX4X_0-1688969415929.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope you get sorted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 06:10:35 GMT</pubDate>
    <dc:creator>kevin.hammond3WX4X</dc:creator>
    <dc:date>2023-07-10T06:10:35Z</dc:date>
    <item>
      <title>Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085929#M3788</link>
      <description>&lt;P&gt;Hello, can someone explain to me why the IF condition cannot be used in this code?&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;time.txt&lt;/STRONG&gt; file contains only the number &lt;STRONG&gt;1688722295&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Interestingly, if I delete the IF condition in this code, the program will work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;FILE OPEN "time.txt" FOR READ AS "inp"
INT $read_seconds = 0
FILE READ $read_seconds FROM "inp"
FILE CLOSE "inp"

INT $diff = time() - $read_seconds

IF $diff &amp;gt; 60 {
	MESSAGE INFO $diff
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Jul 2023 10:38:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085929#M3788</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-07T10:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085937#M3789</link>
      <description>&lt;P&gt;Try this, enclose the condition to be checked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;FILE OPEN "time.txt" FOR READ AS "inp"&lt;/DIV&gt;&lt;DIV&gt;INT $read_seconds = 0&lt;/DIV&gt;&lt;DIV&gt;FILE READ $read_seconds FROM "inp"&lt;/DIV&gt;&lt;DIV&gt;FILE CLOSE "inp"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;INT $diff = time() - $read_seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;IF (&lt;FONT color="#993366"&gt;$diff &amp;gt; 60)&lt;/FONT&gt; {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MESSAGE INFO $diff&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Jul 2023 10:41:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085937#M3789</guid>
      <dc:creator>kevin.hammond3WX4X</dc:creator>
      <dc:date>2023-07-07T10:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085947#M3790</link>
      <description>I've tried and still get the error: unsupported element or command</description>
      <pubDate>Fri, 07 Jul 2023 10:45:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085947#M3790</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-07T10:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085955#M3791</link>
      <description>&lt;P&gt;Works for me, after i put the full path to time.txt in&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;P&gt;FILE OPEN "C:\Users\KevinHammond\Desktop\time.txt" FOR READ AS "inp"&lt;BR /&gt;INT $read_seconds = 0&lt;BR /&gt;FILE READ $read_seconds FROM "inp"&lt;BR /&gt;FILE CLOSE "inp"&lt;BR /&gt;&lt;BR /&gt;INT $diff = time() - $read_seconds&lt;BR /&gt;&lt;BR /&gt;IF ($diff &amp;gt; 60) {&lt;BR /&gt;MESSAGE INFO $diff&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 10:53:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085955#M3791</guid>
      <dc:creator>kevin.hammond3WX4X</dc:creator>
      <dc:date>2023-07-07T10:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085978#M3792</link>
      <description>Thank you then it is not a bug in the code, but in my computer.</description>
      <pubDate>Fri, 07 Jul 2023 11:01:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12085978#M3792</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-07T11:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12086594#M3793</link>
      <description>&lt;P&gt;Make sure the file is not located in folder that doesn't have read/write access like in "Program Files" or something.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 15:06:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12086594#M3793</guid>
      <dc:creator>Sean571</dc:creator>
      <dc:date>2023-07-07T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Betreff: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12086944#M3794</link>
      <description>&lt;P&gt;I'm really confused now. Why does this work with the quotes at "inp" and another recently issue did not?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 17:54:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12086944#M3794</guid>
      <dc:creator>old_snickers</dc:creator>
      <dc:date>2023-07-07T17:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12087831#M3795</link>
      <description>&lt;P&gt;Writing data to the file and reading data from the file works. The macro error occurs when I insert an arbitrary condition in the code. 🫤&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jul 2023 08:29:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12087831#M3795</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-08T08:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12087954#M3796</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4373604"&gt;@old_snickers&lt;/a&gt;&amp;nbsp;Hi. You don't actually need the double quotes around inp, given that this is a single word without spaces.&lt;/P&gt;
&lt;P&gt;See the extract from the Macro Programming Guide below, which shows an example of defining so-called file handles without any quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="file-handle-doc.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238044i4616D15149CA5D9A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="file-handle-doc.png" alt="file-handle-doc.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can find the latest version of the Macro Programming Guide here:&amp;nbsp;&lt;A href="https://www.autodesk.com/support/technical/article/caas/tsarticles/ts/26zXUqtRe1Tur1KdK1pctn.html" target="_blank" rel="noopener"&gt;https://www.autodesk.com/support/technical/article/caas/tsarticles/ts/26zXUqtRe1Tur1KdK1pctn.html &lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(scroll down towards the bottom of the page).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13527687"&gt;@tomanT9U6N&lt;/a&gt;&amp;nbsp;Hi. Unfortunately, I also can't reproduce your error. You might try using the 'macro debugger', it might give a clue to what is going wrong.&lt;/P&gt;
&lt;P&gt;You invoke this by:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;macro debug &amp;lt;path-to-macro-file&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that will help.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:15:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12087954#M3796</guid>
      <dc:creator>lokesh.kalia</dc:creator>
      <dc:date>2023-07-10T06:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090240#M3797</link>
      <description>&lt;P&gt;I more item to check....&lt;/P&gt;&lt;P&gt;Is the macro being run from from a trusted files or trusted directory, i have seen macros questioned from time to time usually if they are stored on a network drive. check options as below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kevinhammond3WX4X_0-1688969415929.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238323i683E03C71E8D9466/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kevinhammond3WX4X_0-1688969415929.png" alt="kevinhammond3WX4X_0-1688969415929.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope you get sorted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:10:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090240#M3797</guid>
      <dc:creator>kevin.hammond3WX4X</dc:creator>
      <dc:date>2023-07-10T06:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090321#M3798</link>
      <description>&lt;P&gt;When I try macro debug, the whole code is displayed in one line. That's weird.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:50:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090321#M3798</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-10T06:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090330#M3799</link>
      <description>&lt;P&gt;Thank you all for your help, but the problem seems to be with my PC.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:57:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090330#M3799</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-10T06:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090628#M3800</link>
      <description>&lt;P&gt;1 last thing based on your last response.&lt;/P&gt;&lt;P&gt;what text editor are you using, i am wondering whether when you hit enter to go to the next line whether you are getting a carriage return line feed command?&lt;/P&gt;&lt;P&gt;I use notedpad++ but windows text editor will do, i would not use wordpad as it can give spurious results.&lt;/P&gt;&lt;P&gt;I have switched on these characters using..View...Show symbols&lt;/P&gt;&lt;P&gt;If you do not have these characters it would cause the whole macro to appear on one line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kevinhammond3WX4X_0-1688980449896.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238440iA24AB28DF7E96D20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kevinhammond3WX4X_0-1688980449896.png" alt="kevinhammond3WX4X_0-1688980449896.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 09:15:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090628#M3800</guid>
      <dc:creator>kevin.hammond3WX4X</dc:creator>
      <dc:date>2023-07-10T09:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when using conditions</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090711#M3801</link>
      <description>&lt;P&gt;&lt;STRONG&gt;You are an absolute legend&lt;/STRONG&gt;! I had the line ordering set to &lt;STRONG&gt;CR&lt;/STRONG&gt;. After switching to &lt;STRONG&gt;CRLF&lt;/STRONG&gt; the macro works!&lt;BR /&gt;Thank you very much&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 09:55:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/problem-when-using-conditions/m-p/12090711#M3801</guid>
      <dc:creator>tomanT9U6N</dc:creator>
      <dc:date>2023-07-10T09:55:20Z</dc:date>
    </item>
  </channel>
</rss>

