<?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: error: bad function: in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798354#M88455</link>
    <description>&lt;PRE&gt;(cond	;begin cond
  (	;cond1
   (= (getvar "ltscale") 1);condition1
   (princ "yes");action 1
  )		;end cond1
  (		;cond2
   T		;condition2
   (princ "hi")	;action 2
  )		;end cond2
)		;end cond&lt;/PRE&gt;
&lt;P&gt;I think it's the format of our cond function&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 15:35:34 GMT</pubDate>
    <dc:creator>Shneuph</dc:creator>
    <dc:date>2019-05-17T15:35:34Z</dc:date>
    <item>
      <title>error: bad function:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798320#M88453</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;
&lt;P&gt;I did a post yesterday about this code, but I got it to work so now I have a different problem. I get an "error: bad function:" after I run it. What would cause the error? See code below. Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	(defun c:plsize()

		(vla-get-canonicalmedianame
		(vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (getvar 'ctab))
		)
	
	)
	
	(DEFUN C:APDF ()
		
			(SETQ A
			(C:PLSIZE)
			)
		
			(COND 
			
					((EQUAL A "ANSI_full_bleed_A_(8.50_x_11.00_Inches)") ( (C:APPDF) ))
					
					((EQUAL A "ANSI_full_bleed_A_(11.00_x_8.50_Inches)") ( (C:LAPDF) ))
					
					((EQUAL A "ANSI_expand_B_(17.00_x_11.00_Inches)") ( (C:BPDF) ))
					
					((EQUAL A "ANSI_expand_C_(22.00_x_17.00_Inches)") ( (C:CPDF) ))
					
					((EQUAL A "ANSI_expand_D_(34.00_x_22.00_Inches)") ( (C:LPDF) ))
					
					
					(t((ALERT "NO LAYOUTS DETECTED")))
			)
			
	)&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 May 2019 15:19:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798320#M88453</guid>
      <dc:creator>anieves228</dc:creator>
      <dc:date>2019-05-17T15:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: error: bad function:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798338#M88454</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6646341"&gt;@anieves228&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... I get an "error: bad function:" after I run it. What would cause the error? ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (t&lt;FONT color="#ff0000"&gt;(&lt;/FONT&gt;(ALERT "NO LAYOUTS DETECTED")&lt;FONT color="#ff0000"&gt;)&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;to this [remove &lt;FONT color="#ff0000"&gt;extra parentheses&lt;/FONT&gt; wrapping]:&lt;BR /&gt;&amp;nbsp; (t (ALERT "NO LAYOUTS DETECTED"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or even just this [if it's the last condition, and only the one thing needs to be done, you don't need the T "trigger"]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ((ALERT "NO LAYOUTS DETECTED"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff9900"&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; and likewise these:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ((EQUAL A "ANSI_full_bleed_A_(8.50_x_11.00_Inches)") &lt;FONT color="#ff0000"&gt;(&lt;/FONT&gt; (C:APPDF)&lt;FONT color="#ff0000"&gt; )&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;to this [and the equivalent for others]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ((EQUAL A "ANSI_full_bleed_A_(8.50_x_11.00_Inches)") (C:APPDF))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To explain further:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ( &lt;FONT color="#00ccff"&gt;; this opens the condition&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (EQUAL A "ANSI_full_bleed_A_(8.50_x_11.00_Inches)")&lt;FONT color="#00ccff"&gt;; the test expression&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(C:APPDF)&lt;FONT color="#00ccff"&gt;; this is what to do if the test returns other-than-nil&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ) &lt;FONT color="#00ccff"&gt;; this closes the condition&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you had it, the what-to-do was:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;(&lt;/FONT&gt;(C:APPDF)&lt;FONT color="#ff0000"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The first thing after a left parenthesis in this situation&amp;nbsp;needs to be the name of the&amp;nbsp;&lt;FONT color="#ff0000"&gt;function&lt;/FONT&gt; that the left parenthesis is opening,&amp;nbsp;but &amp;nbsp;&amp;nbsp;(C:APPDF)&amp;nbsp; &lt;EM&gt;with parentheses included&lt;/EM&gt;&amp;nbsp; is not a function name.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 15:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798338#M88454</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-05-17T15:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: error: bad function:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798354#M88455</link>
      <description>&lt;PRE&gt;(cond	;begin cond
  (	;cond1
   (= (getvar "ltscale") 1);condition1
   (princ "yes");action 1
  )		;end cond1
  (		;cond2
   T		;condition2
   (princ "hi")	;action 2
  )		;end cond2
)		;end cond&lt;/PRE&gt;
&lt;P&gt;I think it's the format of our cond function&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 15:35:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798354#M88455</guid>
      <dc:creator>Shneuph</dc:creator>
      <dc:date>2019-05-17T15:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: error: bad function:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798360#M88456</link>
      <description>&lt;P&gt;Awesome! thank you so much! It working now!&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 15:37:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-bad-function/m-p/8798360#M88456</guid>
      <dc:creator>anieves228</dc:creator>
      <dc:date>2019-05-17T15:37:17Z</dc:date>
    </item>
  </channel>
</rss>

