<?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: Lisp Error in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478651#M129928</link>
    <description>&lt;PRE&gt;(if (equal (assoc 1 (entget (entnext (ssname sel count))))&lt;/PRE&gt;&lt;P&gt;Seems to me you need an else statement.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2016 15:48:15 GMT</pubDate>
    <dc:creator>Jonathan3891</dc:creator>
    <dc:date>2016-08-04T15:48:15Z</dc:date>
    <item>
      <title>Lisp Error</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478547#M129927</link>
      <description>&lt;P&gt;Hey Guys, whats up?&lt;BR /&gt;&lt;BR /&gt;I am developing this code but there is some problem, could anyone help me? Please&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;(defun c:testea ()

    (setq pon (getpoint))
    
    (setq sel (ssget "x" '((0 . "INSERT") (8 . "ELE-BLK-PONTOS"))))
    (setq count 0
	  count2 0
	  hm (sslength sel)
	  list2 '("AC" "AQ" "CF" "CH" "FE" "FP" "LL" "LM"
		  "PM" "SN" "SPA" "TE" "TL" "TP")
    )
	  
    (while (&amp;lt; count hm)

      (if (equal (assoc 1 (entget (entnext (ssname sel count)))) '((progn								
								(while (&amp;lt; count2 13)
								 (if (equal (assoc 1 (entget (entnext (ssname sel count)))) '(strcat "1 ." (nth count2 list2)))(progn
								   (command "_insert" (strcat "C:/PJ/Legenda/" (nth count list2) "(legenda)" pon "1" "" "0"))		
								   (setq count2 (1+ count2))))))))
	
						)))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 15:05:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478547#M129927</guid>
      <dc:creator>IkaroFalcao</dc:creator>
      <dc:date>2016-08-04T15:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478651#M129928</link>
      <description>&lt;PRE&gt;(if (equal (assoc 1 (entget (entnext (ssname sel count))))&lt;/PRE&gt;&lt;P&gt;Seems to me you need an else statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 15:48:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478651#M129928</guid>
      <dc:creator>Jonathan3891</dc:creator>
      <dc:date>2016-08-04T15:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478654#M129929</link>
      <description>&lt;P&gt;Some things I notice [without digging deeply enough to understand fully what it's doing]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;'((progn&amp;nbsp;...&lt;/FONT&gt; and what follows&amp;nbsp;is&amp;nbsp;problematical.&amp;nbsp; The "result" of this is supposedly being compared to the &lt;FONT color="#ff0000"&gt;(assoc 1&amp;nbsp;...&lt;/FONT&gt; line above for (equal)ity -- otherwise the (equal) function doesn't compare anything.&amp;nbsp; I guess the return from a (progn) function can be compared like that, if it's done right.&amp;nbsp; But the asterisk prefix is invalid here.&amp;nbsp; See Help about the (list) and (quote) functions -- the asterisk&amp;nbsp;requires that &lt;EM&gt;nothing inside&amp;nbsp;needs evaluation&lt;/EM&gt; -- no variables, no comparisons, etc. -- but what you have in it is loaded with variables and evaluating-type functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nothing changes the value of the 'count' variable, so the (while) that is based on its value will never end, and will repeat operating on the same thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (if (equal (assoc 1 (entget (entnext (ssname sel count)))) &lt;FONT color="#0000ff"&gt;'(strcat "1 ."&lt;/FONT&gt; (nth count2 list2)))&lt;/P&gt;
&lt;P&gt;is pretty wacky....&amp;nbsp; The 1-code entry in entity data is not a text string, and even if it were, there would need to be another space after the period.&amp;nbsp; I suspect what you need is something more&amp;nbsp;like:&lt;BR /&gt;&amp;nbsp; (if (equal (assoc 1 (entget (entnext (ssname sel count)))) &lt;STRONG&gt;&lt;FONT color="#0000ff"&gt;(cons 1&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;(nth count2 list2)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The (strcat) function in the Insert command doesn't have a closing right parenthesis [it's trying to concatenate the insertion point into the string].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are probably some other things -- those are just the ones that caught my eye.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 15:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error/m-p/6478654#M129929</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-08-04T15:51:30Z</dc:date>
    </item>
  </channel>
</rss>

