<?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: no function definition: nil in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631151#M55437</link>
    <description>OK, I tried some lines, plines and circle, got this:&lt;BR /&gt;&lt;BR /&gt;Select objects: Specify opposite corner: 9 found&lt;BR /&gt;Select objects:&lt;BR /&gt;"LINE" ; error: no function definition: VLAX-CURVE-GETENDPARAM</description>
    <pubDate>Sat, 18 Sep 2021 07:54:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-18T07:54:24Z</dc:date>
    <item>
      <title>; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10616789#M55421</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I worked with .lsp below about 4 years and now it's not working. I didn't change the file, that error just happened. What should I do to make it work with AutoCAD 2020?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:elen(/ fList firSet entSet filOut entList totLen)
  (vl-load-com)
  (setq fList '((-4 . "&amp;lt;OR")(0 . "*LINE")
      (0 . "CIRCLE")(0 . "ARC")
      (0 . "ELLIPSE")(-4 . "OR&amp;gt;")
      (-4 . "&amp;lt;NOT")(0 . "MLINE")
      (-4 . "NOT&amp;gt;"))
   filOut 0
   ); end setq
  (if
    (not
      (and
   (setq firSet(ssget "_I")
         entSet(ssget "_I" fList)
         ); end setq
   ); end and
      ); end not
    (setq entSet(ssget fList))
    (setq filOut(-(sslength firSet)(sslength entset)))
    ); end if
  (if entSet
    (progn
      (setq entList
      (mapcar 'vlax-ename-&amp;gt;vla-object
                    (vl-remove-if 'listp
                     (mapcar 'cadr(ssnamex entSet))))
       totLen
        (apply '+
          (mapcar '(lambda (x)
                (vlax-curve-getDistAtParam x
             (vlax-curve-getEndParam x)))
             entList); end mapcar
          ); end apply
       ); end setq
      (if(/= 0 filOut)
   (princ(strcat "\n" (itoa filout)
            " were filtered out (unsupported type)"))
   ); end if
      (princ(strcat "\nTotal entities: "(itoa(length entList))
          " Total length: "(rtos totLen)); end strcat
       ); end princ
      ); end progn
    (progn
        (if(/= 0 filOut)
   (princ(strcat "\n" (itoa filout)
            " were filtered out (unsupported type)"))
   (princ "\nNothing selected")
   ); end if
    ); end progn
    ); end if
      (princ)
      ); end c:elen&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 12 Sep 2021 13:56:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10616789#M55421</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-12T13:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10616975#M55422</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;What version of Acad you are using? Code looks OK and works well.&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun c:elen(/ fList firSet entSet filOut entList totLen)
	(vl-load-com)
	(setq fList '((-4 . "&amp;lt;OR")(0 . "*LINE") (0 . "CIRCLE")(0 . "ARC") (0 . "ELLIPSE")(-4 . "OR&amp;gt;") (-4 . "&amp;lt;NOT")(0 . "MLINE") (-4 . "NOT&amp;gt;")))
	(setq filOut 0)
	(if(not(and(setq firSet(ssget "_I") entSet(ssget "_I" fList))))
		(setq entSet(ssget fList))
		(setq filOut(-(sslength firSet)(sslength entset)))
    )
	(if entSet
		(progn
			(setq 
				entList(mapcar 'vlax-ename-&amp;gt;vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex entSet))))
				totLen (apply '+ (mapcar '(lambda (x) (vlax-curve-getDistAtParam x (vlax-curve-getEndParam x))) entList))
			)
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout)" were filtered out (unsupported type)"))
				(princ(strcat "\nTotal entities: "(itoa(length entList))" Total length: "(rtos totLen)))
			)
		)
		(progn
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout) " were filtered out (unsupported type)"))
				(princ "\nNothing selected")
			)
		)
	)
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Sep 2021 16:45:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10616975#M55422</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-12T16:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10617464#M55423</link>
      <description>&lt;P&gt;Maybe I am missing something (ssget '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))) will only get these type of objects.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 01:17:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10617464#M55423</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-09-13T01:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618312#M55424</link>
      <description>&lt;P&gt;It's not clear to me from your description whether it was working in AutoCAD 2020 but has stopped working, or whether it was working in previous versions but has never worked in 2020.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, though the question of selection-set filtering is probably irrelevant to the error message described, you can simplify that.&amp;nbsp; And you should omit XLINEs as well as MLINEs [your selection will find them, but the function to get their length will fail].&amp;nbsp; To find all finite (vlax-curve...)-class objects using *LINE to cover LINE/SPLINE/LWPOLYLINE/POLYLINE, but omitting XLINE &amp;amp; MLINE:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;(ssget '((0 . "*LINE,ARC,CIRCLE,ELLIPSE") (-4 . "&amp;lt;NOT") (0 . "XLINE,MLINE") (-4 . "NOT&amp;gt;")))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 11:19:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618312#M55424</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-13T11:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618423#M55425</link>
      <description>I use 2020 and yours code didn't work as well &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Mon, 13 Sep 2021 11:59:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618423#M55425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-13T11:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618440#M55426</link>
      <description>Worked in ACAD2020 and stopped work in ACAD2020. Where should I add this line?</description>
      <pubDate>Mon, 13 Sep 2021 12:05:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618440#M55426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-13T12:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618498#M55427</link>
      <description>&lt;P&gt;test&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 12:59:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618498#M55427</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-13T12:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618591#M55428</link>
      <description>&lt;P&gt;Try this but I doubt that problem is with selection filter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(defun c:elen(/ fList firSet entSet filOut entList totLen)
	(vl-load-com)
	(setq fList '((-4 . "&amp;lt;OR")(0 . "*LINE") (0 . "CIRCLE")(0 . "ARC") (0 . "ELLIPSE")(-4 . "OR&amp;gt;") (-4 . "&amp;lt;NOT")(0 . "MLINE,XLINE")(-4 . "NOT&amp;gt;")))
	(setq filOut 0)
	
	(if(not(and(setq firSet(ssget "_I") entSet(ssget "_I" fList))))
		(setq entSet(ssget fList))
		(setq filOut(-(sslength firSet)(sslength entset)))
    )
	(if entSet
		(progn
			(setq 
				entList(mapcar 'vlax-ename-&amp;gt;vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex entSet))))
				totLen (apply '+ (mapcar '(lambda (x) (vlax-curve-getDistAtParam x (vlax-curve-getEndParam x))) entList))
			)
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout)" were filtered out (unsupported type)"))
				(princ(strcat "\nTotal entities: "(itoa(length entList))" Total length: "(rtos totLen 2 2)))
			)
		)
		(progn
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout) " were filtered out (unsupported type)"))
				(princ "\nNothing selected")
			)
		)
	)
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 13:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618591#M55428</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-13T13:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618600#M55429</link>
      <description>Still doesn't work. Maybe I need to reinstall ACAD</description>
      <pubDate>Mon, 13 Sep 2021 13:19:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618600#M55429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-13T13:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618639#M55430</link>
      <description>&lt;P&gt;I don' think you need&amp;nbsp; to reinstall if other lisps are working ok. We will find the problem but it needs some effort.&lt;/P&gt;&lt;P&gt;This error message appears in case when some of used function returns nil that compiler can recognize as function (nil). Maybe implied selection "_I" causes some error or these line has to be written again. There can be some other issues. Does this happen with all drawings or in some particular.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 13:39:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618639#M55430</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-13T13:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618769#M55431</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;Worked in ACAD2020 and stopped work in ACAD2020. Where should I add this line?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So it is apparently not version-related.&amp;nbsp; Something else has changed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be able to replace this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq fList '((-4 . "&amp;lt;OR")(0 . "*LINE")&lt;BR /&gt;&amp;nbsp; (0 . "CIRCLE")(0 . "ARC")&lt;BR /&gt;&amp;nbsp; (0 . "ELLIPSE")(-4 . "OR&amp;gt;")&lt;BR /&gt;&amp;nbsp; (-4 . "&amp;lt;NOT")(0 . "MLINE")&lt;BR /&gt;&amp;nbsp; (-4 . "NOT&amp;gt;"))&lt;BR /&gt;&amp;nbsp; filOut 0&lt;BR /&gt;); end setq&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq&lt;BR /&gt;&amp;nbsp; fList '((0 . "*LINE,ARC,CIRCLE,ELLIPSE") (-4 . "&amp;lt;NOT") (0 . "XLINE,MLINE") (-4 . "NOT&amp;gt;"))&lt;BR /&gt;&amp;nbsp; filOut 0&lt;BR /&gt;); end setq&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But again, I don't see how that change could fix the error you're getting -- it's only a simplified selection-set filter list, and the error is not about selection.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 14:20:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10618769#M55431</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-13T14:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10619440#M55432</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;I worked with .lsp below about 4 years and now it's not working. I didn't change the file, that error just happened. What should I do to make it work with AutoCAD 2020?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There doesnt seem to be any obvious reason for the posted code to not work in 2020.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any lisp program that works on 2020? Are there any other programs loaded at startup?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did the error appeared after you run the program?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Judging by the error message, the program is trying to evaluate a variable with an undefined function&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;((if nil
  	princ po) "\nSay Hello to little friend")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Since po is not a defined function, that same error message will appear&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;To make it easy for everybody, debug the lisp code by using VLIDE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Command: VLIDE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Open the lisp file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;On the menu, go to Debug and choose Break on Error.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;load the lisp via Ctrl+Alt+E &amp;lt;-- very important&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Go back to Autocad drawing session and run your code. if theres an error, vlide will be activated.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;To see where the error on the code, go to Debug / Last Break source, the line with error will be highlghted.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Otherwise just post a sample drawing where the code does not work.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 18:56:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10619440#M55432</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-13T18:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627406#M55433</link>
      <description>&lt;P&gt;Broke on this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt; (mapcar 'vlax-ename-&amp;gt;vla-object
                    (vl-remove-if 'listp
                     (mapcar 'cadr(ssnamex entSet))))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 16 Sep 2021 16:21:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627406#M55433</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-16T16:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627411#M55434</link>
      <description>&lt;P&gt;Yeah, no fix &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 16:21:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627411#M55434</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-16T16:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627539#M55435</link>
      <description>&lt;P&gt;Lets test if we change the way the program iterates thru the selection&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:elen(/ fList firSet entSet filOut entList totLen)
	(vl-load-com)
	(setq fList '((-4 . "&amp;lt;OR")(0 . "*LINE") (0 . "CIRCLE")(0 . "ARC")
		      (0 . "ELLIPSE")(-4 . "OR&amp;gt;") (-4 . "&amp;lt;NOT")(0 . "MLINE") (-4 . "NOT&amp;gt;")))
	(setq filOut 0 totLen 0)
	(if(not(and(setq firSet(ssget "_I") entSet(ssget "_I" fList))))
		 (setq entSet(ssget fList))
		(setq filOut(-(sslength firSet)(sslength entset)))
    )
	(if entSet
		(progn
		  (repeat (setq i (sslength entSet))
		    (setq e (ssname entSet (setq i (1- i))))
		    	(setq totLen (+ totLen (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))))
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout)" were filtered out (unsupported type)"))
				(princ(strcat "\nTotal entities: "(itoa(length entList))" Total length: "(rtos totLen)))
			)
		)
		(progn
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout) " were filtered out (unsupported type)"))
				(princ "\nNothing selected")
			)
		)
	)
	(princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if that fails, let see where or what object cause the error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun c:eDen (/ fList errors firSet entSet filOut entList totLen)
	(vl-load-com)
	(setq fList '((-4 . "&amp;lt;OR")(0 . "*LINE") (0 . "CIRCLE")(0 . "ARC")
		      (0 . "ELLIPSE")(-4 . "OR&amp;gt;") (-4 . "&amp;lt;NOT")(0 . "MLINE") (-4 . "NOT&amp;gt;")))
	(setq filOut 0 totLen 0)
	(if(not(and(setq firSet(ssget "_I") entSet(ssget "_I" fList))))
		 (setq entSet(ssget fList))
		(setq filOut(-(sslength firSet)(sslength entset)))
    )
	(if entSet
		(progn
		  (repeat (setq i (sslength entSet))
		    (setq e (ssname entSet (setq i (1- i)))
			  ent (entget e))
		    (print (Cdr (assoc 0 ent)))
		    (if (not (vl-catch-all-error-p
			  (Setq theLength (vl-catch-all-apply 'vlax-curve-getdistatparam
					    (list e (vlax-curve-getendparam e)))))
			     )
			(setq totLen (+ totLen theLength))
		      	(setq errors (cons (list (Cdr (assoc 0 ent))) errors)) 
		    )
		    )
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout)" were filtered out (unsupported type)"))
				(princ(strcat "\nTotal entities: "(itoa(length entList))" Total length: "(rtos totLen)))
			)
		)
		(progn
			(if(/= 0 filOut)
				(princ(strcat "\n" (itoa filout) " were filtered out (unsupported type)"))
				(princ "\nNothing selected")
			)
		)
	)(if errors (print errors))
   (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;command: Eden&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 17:30:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627539#M55435</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-16T17:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627634#M55436</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Broke on this:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt; (mapcar 'vlax-ename-&amp;gt;vla-object
                    (vl-remove-if 'listp
                     (mapcar 'cadr(ssnamex entSet))))&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Again, this may not fix the problem, but I notice the fact that it's converting everything to VLA objects.&amp;nbsp; That's not necessary for what the routine does with them -- (vlax-curve...) functions can take just entity names, without conversion.&amp;nbsp; That much should be replaceable with just:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(vl-remove-if 'listp (mapcar 'cadr (ssnamex entSet)))&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 18:15:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10627634#M55436</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-09-16T18:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631151#M55437</link>
      <description>OK, I tried some lines, plines and circle, got this:&lt;BR /&gt;&lt;BR /&gt;Select objects: Specify opposite corner: 9 found&lt;BR /&gt;Select objects:&lt;BR /&gt;"LINE" ; error: no function definition: VLAX-CURVE-GETENDPARAM</description>
      <pubDate>Sat, 18 Sep 2021 07:54:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631151#M55437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-18T07:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631158#M55438</link>
      <description>Tried, now this:&lt;BR /&gt;&lt;BR /&gt;Command: ELEN&lt;BR /&gt;; error: no function definition: VLAX-CURVE-GETENDPARAM</description>
      <pubDate>Sat, 18 Sep 2021 07:56:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631158#M55438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-18T07:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631217#M55439</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;Tried, now this:&lt;BR /&gt;&lt;BR /&gt;Command: ELEN&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;; error: no function definition: VLAX-CURVE-GETENDPARAM&lt;/FONT&gt;&lt;/STRONG&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;There's your answer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;This query by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp; was never really confirmed by you&amp;nbsp;@Anonymous&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3" color="#003366"&gt;&lt;EM&gt;- It's not clear to me from your description whether it was working in AutoCAD 2020 but has stopped working, or whether it was working in previous versions but has never worked in 2020.-&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;I guess it is now, &lt;/STRONG&gt;the code at post # 1 clearly shows (vl-load-com) is loaded and should be working but the error that you get&amp;nbsp; &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;right there&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;shows otherwise.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;That means the ActiveX function are not loaded despite you run (vl-load-com). O&lt;/SPAN&gt;&lt;SPAN&gt;nly a clean uninstall / reinstall of AutoCAD can solve your issue.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 08:59:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631217#M55439</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-18T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: ; error: no function definition: nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631233#M55440</link>
      <description>&lt;P&gt;In your other lisps, are you using variables with the same name as a function?&lt;/P&gt;&lt;P&gt;If it worked before and over time now it doesn't, and you know for a fact that nothing changed, it's obviously not the code that it broke in. So why is everyone trying to change this code? lol&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Look at the error, it says no function definition: nil&lt;/P&gt;&lt;P&gt;Well where did it break at? You cannot overwrite &lt;A href="https://documentation.help/AutoCAD-ALISP-VLISP/WS73099cc142f4875516d84be10ebc87a53f-7c3c.htm" target="_blank" rel="noopener"&gt;special form lisp functions.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So the following are the possibilities. Somewhere, one of these functions are used as variables and it got overwritten with nil.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;; ssget
;; sslength
;; mapcar
;; cadr
;; ssnamex
;; vl-remove-if
;; listp
;; vlax-curve-getDistAtParam
;; vlax-curve-getEndParam
;; itoa
;; strcat
;; length
;; rtos
;; +
;; /=
;; princ&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 09:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-no-function-definition-nil/m-p/10631233#M55440</guid>
      <dc:creator>jtoverka</dc:creator>
      <dc:date>2021-09-18T09:21:35Z</dc:date>
    </item>
  </channel>
</rss>

