<?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: AutoLisp IF statement just not working as it should? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846444#M12779</link>
    <description>&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing, my AutoLisp picks points at 1 decimal place, how did you get it to pick 3 decimal place.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2024 10:56:22 GMT</pubDate>
    <dc:creator>mkh94</dc:creator>
    <dc:date>2024-06-18T10:56:22Z</dc:date>
    <item>
      <title>AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846285#M12775</link>
      <description>&lt;P&gt;Yes, the title as confusing as it sounds, the code I have wrote, does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A quick background so you can understand the code, I am a Land Surveyor and I have made a code where when we use a 3D delivery, we can use this code. &lt;STRONG&gt;When we have the exact cover level, it extracts the z-value of that and allows the user to enter the pipe depth and reduces the z-value of that pipe line to its new.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I decided to reduce it to a AutoLisp code because otherwise you will have to go through ID the pipe line and knowing which point (start or end) it is then using a calculator to work out the pipe line new z-value and then going into properties and changing it)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the AutoLisp routine does not work as it should, my main two lines that are not working are lines 19 and 31 where it starts with the If statements and its condition, the condition output is 'nil'. I have even put in the &lt;STRONG&gt;command prompt in AutoCAD: &lt;EM&gt;(= var1 var2)&lt;/EM&gt; (using the respected variables) and the output is still 'nil'.&lt;/STRONG&gt; Every other line works, and the code within the 'if' routine works too when entered one by one manually, however, &lt;STRONG&gt;its just that the 'if' statement does not trigger.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the file below, the command won't present 'nil' anymore when you are running the code as I have put a "Not a start/end" point prompt, but after running the code, type in the command line in AutoCAD:&amp;nbsp;&lt;EM&gt;(= pt spoint)&lt;/EM&gt; &amp;lt;or&amp;gt; &lt;EM&gt;(= pt epoint)&amp;nbsp;&lt;/EM&gt; where you will see the error. I might have a rough idea of what it can be, could it be the way I am getting the variables that the&amp;nbsp;&lt;EM&gt;spoint/epoint&lt;/EM&gt; variable are a different type compared to the &lt;EM&gt;pt&amp;nbsp;&lt;/EM&gt; as I used the (getpoint) for one and the (entget) for another? No idea, just throwing my thoughts that I can't seem to solve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 09:21:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846285#M12775</guid>
      <dc:creator>mkh94</dc:creator>
      <dc:date>2024-06-18T09:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846384#M12776</link>
      <description>&lt;P&gt;To compare two lists use function equal instead of =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(if (equal pt spoint).......)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 10:19:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846384#M12776</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2024-06-18T10:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846391#M12777</link>
      <description>&lt;P&gt;Just tried that, and same result, pops up as nil.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 10:23:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846391#M12777</guid>
      <dc:creator>mkh94</dc:creator>
      <dc:date>2024-06-18T10:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846404#M12778</link>
      <description>&lt;P&gt;Yes because you are comparing real numbers inside lists, so you have to use some tolerance&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Command: (SETQ A (GETPOINT "/nPOINT &amp;gt;") &amp;gt; (321.784 385.992 0.0)
Command: (setq B (mapcar '+ a '(0.0001 0.0001 0.0001)))  &amp;gt; (321.784 385.992 0.0001)
Command: (apply '= (mapcar '(lambda (x y) (equal x y 1e-4)) a b))
T&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Jun 2024 10:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846404#M12778</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2024-06-18T10:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846444#M12779</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing, my AutoLisp picks points at 1 decimal place, how did you get it to pick 3 decimal place.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 10:56:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846444#M12779</guid>
      <dc:creator>mkh94</dc:creator>
      <dc:date>2024-06-18T10:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846466#M12780</link>
      <description>&lt;P&gt;&lt;A href="https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-5FFF39D6-EFC7-49F5-B56A-6023EB5C0DE7" target="_blank" rel="noopener"&gt;Check how LUPREC variable is set at your side&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 11:09:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846466#M12780</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2024-06-18T11:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846711#M12781</link>
      <description>I've tried that but didn't help the AutoLisp command. It only helps with the AutoCAD commands itself. When I use the command entget or getpoint or something similar, it only gives me the precision upto 1 decimal point, even the 1 decimal point it's still at (x.0 x.0 x.0)</description>
      <pubDate>Tue, 18 Jun 2024 13:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846711#M12781</guid>
      <dc:creator>mkh94</dc:creator>
      <dc:date>2024-06-18T13:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp IF statement just not working as it should?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846863#M12782</link>
      <description>&lt;P&gt;The&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (rtos)&lt;/STRONG&gt; &lt;/FONT&gt;function can take mode and precision arguments.&amp;nbsp; If you want to see&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; &lt;FONT color="#0000FF"&gt;3&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;decimal places, change&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(rtos newZvalue)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(rtos newZvalue 2 &lt;FONT color="#0000FF"&gt;3&lt;/FONT&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;[The 2 is for decimal mode.&amp;nbsp; Read about the function in the AutoLisp Reference.]&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;DIM&lt;FONT color="#FF0000"&gt;Z&lt;/FONT&gt;IN&lt;/STRONG&gt; System Variable setting controls whether leading and/or trailing &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Z&lt;/STRONG&gt;&lt;/FONT&gt;eroes are shown.&amp;nbsp; [It's named for application in &lt;STRONG&gt;DIM&lt;/STRONG&gt;ensions, and whether &lt;STRONG&gt;Z&lt;/STRONG&gt;ero &lt;STRONG&gt;IN&lt;/STRONG&gt;ches are shown when in feet-and-inches mode, but it applies to&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (rtos)&lt;/STRONG&gt; &lt;/FONT&gt;returns also -- read about that, too.]&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 14:08:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-if-statement-just-not-working-as-it-should/m-p/12846863#M12782</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-06-18T14:08:39Z</dc:date>
    </item>
  </channel>
</rss>

