<?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: in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784157#M162268</link>
    <description>I have to agree. (not (null)) is a double negative and therefore amounts to&lt;BR /&gt;
no test at all. Which is why Paul recommended the simple (if ss1) in the&lt;BR /&gt;
first place.&lt;BR /&gt;
&lt;BR /&gt;
"Paul Turvill" &lt;NO&gt; wrote in message&lt;BR /&gt;
news:82p3kv$qgk4@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Nope.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (if ss1 ...)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; is all you need.&lt;BR /&gt;
&amp;gt; __&lt;BR /&gt;
&amp;gt; David Brewer &lt;CADRAGON&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:384FF32F.354165F6@onr.com...&lt;BR /&gt;
&amp;gt; &amp;gt; I think what you need here is the (null) function.  (null item)&lt;BR /&gt;
&amp;gt; verifies that&lt;BR /&gt;
&amp;gt; &amp;gt; the item, in this case your ss1, is bound to nil. and the (not)&lt;BR /&gt;
&amp;gt; reverses the&lt;BR /&gt;
&amp;gt; &amp;gt; result...&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
&amp;gt; &amp;gt; you should use   (if (not (null ss1)) ...)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/CADRAGON&gt;&lt;/NO&gt;</description>
    <pubDate>Fri, 10 Dec 1999 15:27:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>1999-12-10T15:27:02Z</dc:date>
    <item>
      <title>nil??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784152#M162263</link>
      <description>When aquiring a selection set with ssget for all "dimension" in a drawing&lt;BR /&gt;
with (setq ss1 (ssget "x" '((0 . "dimension")))), I would like to check to&lt;BR /&gt;
see if it is not nil before working on it.  I've tried (if (/= ss1 nil))&lt;BR /&gt;
and (if (/= ss1 "")), but these don't seem to work.  Does anybody know the&lt;BR /&gt;
correct way of accomplishing this simple task??&lt;BR /&gt;
&lt;BR /&gt;
Tips appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Scott B.</description>
      <pubDate>Mon, 06 Dec 1999 13:45:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784152#M162263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-06T13:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: nil??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784153#M162264</link>
      <description>(not ss1) will return T if the selection set is empty.</description>
      <pubDate>Mon, 06 Dec 1999 14:17:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784153#M162264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-06T14:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: nil??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784154#M162265</link>
      <description>(if ss1&lt;BR /&gt;
 (progn&lt;BR /&gt;
  do something&lt;BR /&gt;
 )&lt;BR /&gt;
(prompt "\nNothing selected!")&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
-gnb&lt;BR /&gt;
&lt;BR /&gt;
Scott Bellows wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; When aquiring a selection set with ssget for all "dimension" in a drawing&lt;BR /&gt;
&amp;gt; with (setq ss1 (ssget "x" '((0 . "dimension")))), I would like to check to&lt;BR /&gt;
&amp;gt; see if it is not nil before working on it.  I've tried (if (/= ss1 nil))&lt;BR /&gt;
&amp;gt; and (if (/= ss1 "")), but these don't seem to work.  Does anybody know the&lt;BR /&gt;
&amp;gt; correct way of accomplishing this simple task??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Tips appreciated!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Scott B.</description>
      <pubDate>Mon, 06 Dec 1999 17:43:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784154#M162265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-06T17:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: nil??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784155#M162266</link>
      <description>I think what you need here is the (null) function.  (null item) verifies that&lt;BR /&gt;
the item, in this case your ss1, is bound to nil. and the (not) reverses the&lt;BR /&gt;
result...&lt;BR /&gt;
&lt;BR /&gt;
So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
you should use   (if (not (null ss1)) ...)&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
David&lt;BR /&gt;
&lt;BR /&gt;
Scott Bellows wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; When aquiring a selection set with ssget for all "dimension" in a drawing&lt;BR /&gt;
&amp;gt; with (setq ss1 (ssget "x" '((0 . "dimension")))), I would like to check to&lt;BR /&gt;
&amp;gt; see if it is not nil before working on it.  I've tried (if (/= ss1 nil))&lt;BR /&gt;
&amp;gt; and (if (/= ss1 "")), but these don't seem to work.  Does anybody know the&lt;BR /&gt;
&amp;gt; correct way of accomplishing this simple task??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Tips appreciated!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Scott B.</description>
      <pubDate>Thu, 09 Dec 1999 18:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784155#M162266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-09T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784156#M162267</link>
      <description>Nope.&lt;BR /&gt;
&lt;BR /&gt;
(if ss1 ...)&lt;BR /&gt;
&lt;BR /&gt;
is all you need.&lt;BR /&gt;
__&lt;BR /&gt;
David Brewer &lt;CADRAGON&gt; wrote in message&lt;BR /&gt;
news:384FF32F.354165F6@onr.com...&lt;BR /&gt;
&amp;gt; I think what you need here is the (null) function.  (null item)&lt;BR /&gt;
verifies that&lt;BR /&gt;
&amp;gt; the item, in this case your ss1, is bound to nil. and the (not)&lt;BR /&gt;
reverses the&lt;BR /&gt;
&amp;gt; result...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
&amp;gt; you should use   (if (not (null ss1)) ...)&lt;/CADRAGON&gt;</description>
      <pubDate>Thu, 09 Dec 1999 20:32:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784156#M162267</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-09T20:32:05Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784157#M162268</link>
      <description>I have to agree. (not (null)) is a double negative and therefore amounts to&lt;BR /&gt;
no test at all. Which is why Paul recommended the simple (if ss1) in the&lt;BR /&gt;
first place.&lt;BR /&gt;
&lt;BR /&gt;
"Paul Turvill" &lt;NO&gt; wrote in message&lt;BR /&gt;
news:82p3kv$qgk4@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Nope.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (if ss1 ...)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; is all you need.&lt;BR /&gt;
&amp;gt; __&lt;BR /&gt;
&amp;gt; David Brewer &lt;CADRAGON&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:384FF32F.354165F6@onr.com...&lt;BR /&gt;
&amp;gt; &amp;gt; I think what you need here is the (null) function.  (null item)&lt;BR /&gt;
&amp;gt; verifies that&lt;BR /&gt;
&amp;gt; &amp;gt; the item, in this case your ss1, is bound to nil. and the (not)&lt;BR /&gt;
&amp;gt; reverses the&lt;BR /&gt;
&amp;gt; &amp;gt; result...&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
&amp;gt; &amp;gt; you should use   (if (not (null ss1)) ...)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/CADRAGON&gt;&lt;/NO&gt;</description>
      <pubDate>Fri, 10 Dec 1999 15:27:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784157#M162268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-10T15:27:02Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784158#M162269</link>
      <description>I disagree, Frank...    in lisp, (not (null ss1)) is not a double negative...&lt;BR /&gt;
(not) is a negative, but (null ss1) tests to see if the item is bound to nil&lt;BR /&gt;
(nothing).  If ss1 is not nil; (not (null ss1)) returns T, which is what he was&lt;BR /&gt;
trying to do with with (/= ss1 nil)...&lt;BR /&gt;
&lt;BR /&gt;
As someone else said earlier, there is always several ways to get where you're&lt;BR /&gt;
going in Lisp.&lt;BR /&gt;
&lt;BR /&gt;
BUT, as Paul pointed out... all of this amounts to nil anyway, since (if ss1&lt;BR /&gt;
...) is all that's really necessary to test ss1.....     &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I have to agree. (not (null)) is a double negative and therefore amounts to&lt;BR /&gt;
&amp;gt; no test at all. Which is why Paul recommended the simple (if ss1) in the&lt;BR /&gt;
&amp;gt; first place.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Paul Turvill" &lt;NO&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:82p3kv$qgk4@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; &amp;gt; Nope.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (if ss1 ...)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; is all you need.&lt;BR /&gt;
&amp;gt; &amp;gt; __&lt;BR /&gt;
&amp;gt; &amp;gt; David Brewer &lt;CADRAGON&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:384FF32F.354165F6@onr.com...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; I think what you need here is the (null) function.  (null item)&lt;BR /&gt;
&amp;gt; &amp;gt; verifies that&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; the item, in this case your ss1, is bound to nil. and the (not)&lt;BR /&gt;
&amp;gt; &amp;gt; reverses the&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; result...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; you should use   (if (not (null ss1)) ...)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;/CADRAGON&gt;&lt;/NO&gt;</description>
      <pubDate>Sun, 12 Dec 1999 06:05:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784158#M162269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-12T06:05:08Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784159#M162270</link>
      <description>&amp;gt;So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
&amp;gt;you should use   (if (not (null ss1)) ...)&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;...in lisp, (not (null ss1)) is not a double negative...&lt;BR /&gt;
&amp;gt;(not) is a negative, but (null ss1) tests to see if the item is bound to nil&lt;BR /&gt;
&amp;gt;(nothing).  If ss1 is not nil; (not (null ss1)) returns T, which is what he was&lt;BR /&gt;
&amp;gt;trying to do with with (/= ss1 nil)...&lt;BR /&gt;
&lt;BR /&gt;
Bleah!&lt;BR /&gt;
&lt;BR /&gt;
As I'msure you know, any variable that is "bound to nil" is exactly&lt;BR /&gt;
the same as an unbound variable for the purposes of conditional&lt;BR /&gt;
testing. Conditional expressions always test for a non-nil evaluation,&lt;BR /&gt;
i.e. a variable bound to a value or another test expression that&lt;BR /&gt;
passes. Anything else is nil and the test fails. Whether some variable&lt;BR /&gt;
was explicitly set to nil is irrelevant.&lt;BR /&gt;
&lt;BR /&gt;
e.g.&lt;BR /&gt;
&lt;BR /&gt;
!var&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
(if var "Yup") -&amp;gt; nil&lt;BR /&gt;
(setq var nil) -&amp;gt; nil&lt;BR /&gt;
(null var) -&amp;gt; T&lt;BR /&gt;
(if var "Yup") -&amp;gt; nil&lt;BR /&gt;
&lt;BR /&gt;
In short, any conditional test that performs a (not (null var)) is&lt;BR /&gt;
about as redundant and sloppy as you can get, and you probably didn't&lt;BR /&gt;
properly set up the test expression to begin with.&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; When aquiring a selection set with ssget for all "dimension" in a drawing&lt;BR /&gt;
&amp;gt; with (setq ss1 (ssget "x" '((0 . "dimension")))), I would like to check to&lt;BR /&gt;
&amp;gt; see if it is not nil before working on it.  I've tried (if (/= ss1 nil))&lt;BR /&gt;
&amp;gt; and (if (/= ss1 "")), but these don't seem to work.  Does anybody know the&lt;BR /&gt;
&amp;gt; correct way of accomplishing this simple task??&lt;BR /&gt;
&lt;BR /&gt;
The correct way of doing this is&lt;BR /&gt;
&lt;BR /&gt;
(if (setq ss1 (ssget "x" '((0 . "dimension"))))&lt;BR /&gt;
  (DoSomething)&lt;BR /&gt;
  (DoSomethingElse)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
Also, the string "" is NOT the same as nil - it is a null string&lt;BR /&gt;
value.&lt;BR /&gt;
&lt;BR /&gt;
Matt&lt;BR /&gt;
stachoni@bellatlantic.net&lt;BR /&gt;
&lt;BR /&gt;
On Sun, 12 Dec 1999 00:05:08 -0600, David Brewer &lt;CADRAGON&gt;&lt;BR /&gt;
wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;I disagree, Frank...    in lisp, (not (null ss1)) is not a double negative...&lt;BR /&gt;
&amp;gt;(not) is a negative, but (null ss1) tests to see if the item is bound to nil&lt;BR /&gt;
&amp;gt;(nothing).  If ss1 is not nil; (not (null ss1)) returns T, which is what he was&lt;BR /&gt;
&amp;gt;trying to do with with (/= ss1 nil)...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;As someone else said earlier, there is always several ways to get where you're&lt;BR /&gt;
&amp;gt;going in Lisp.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;BUT, as Paul pointed out... all of this amounts to nil anyway, since (if ss1&lt;BR /&gt;
&amp;gt;...) is all that's really necessary to test ss1.....     &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Frank Oquendo wrote:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; I have to agree. (not (null)) is a double negative and therefore amounts to&lt;BR /&gt;
&amp;gt;&amp;gt; no test at all. Which is why Paul recommended the simple (if ss1) in the&lt;BR /&gt;
&amp;gt;&amp;gt; first place.&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; "Paul Turvill" &lt;NO&gt; wrote in message&lt;BR /&gt;
&amp;gt;&amp;gt; news:82p3kv$qgk4@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; Nope.&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; (if ss1 ...)&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; is all you need.&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; __&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; David Brewer &lt;CADRAGON&gt; wrote in message&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; news:384FF32F.354165F6@onr.com...&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; &amp;gt; I think what you need here is the (null) function.  (null item)&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; verifies that&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; &amp;gt; the item, in this case your ss1, is bound to nil. and the (not)&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; reverses the&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; &amp;gt; result...&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; &amp;gt; So instead of     (if (/= ss1 nil)...)&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt; &amp;gt; you should use   (if (not (null ss1)) ...)&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;/CADRAGON&gt;&lt;/NO&gt;&lt;/CADRAGON&gt;</description>
      <pubDate>Tue, 21 Dec 1999 19:41:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/nil/m-p/784159#M162270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-12-21T19:41:22Z</dc:date>
    </item>
  </channel>
</rss>

