<?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- No Function Definition in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827071#M68525</link>
    <description>&lt;P&gt;I think (vl-load-com) is already at the beginning of the code? The problem appears to be specific to this particular lisp (others I have on hand seem to work fine) I did do a reinstall a couple months ago but I have definitely used the lisp after that was complete. I'm using C3D 2020 but it's on a work computer (PC) so I'm not totally sure if any updates would have been done without my knowledge. Would an update be able to render the lisp inoperable?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 12:25:02 GMT</pubDate>
    <dc:creator>rmordov</dc:creator>
    <dc:date>2020-10-27T12:25:02Z</dc:date>
    <item>
      <title>Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824165#M68521</link>
      <description>&lt;P&gt;I am running into the following error when attempting to use a custom lisp. "Error: no function definition: VLAX-ENAME-&amp;gt;VLA-OBJECT" I found a few other posts regarding no function defintion but all were more customized to the specific lisp. I am newer to C3D and don't know much about writing my own lisp codes but have found several I use often. I've used this same lisp in the same drawing I'm getting the error in multiple times and have never run into this issue. Any ideas what might cause this problem out of nowhere? Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;(defun c:mlte (/) (c:MLeaderToExistingtext))&lt;BR /&gt;(defun c:MLeaderToExistingtext (/)&lt;BR /&gt;(vl-load-com)&lt;BR /&gt;(cond&lt;BR /&gt;;;Select the text/mtext objects&lt;BR /&gt;((or&lt;BR /&gt;(null (setq ss1 (ssget ":S" '((0 . "text,mtext")))))&lt;BR /&gt;(= 0 (setq ssl (sslength ss1)))&lt;BR /&gt;)&lt;BR /&gt;nil ;nothing selected&lt;BR /&gt;)&lt;BR /&gt;(T&lt;BR /&gt;(setq&lt;BR /&gt;Textobj (vlax-ename-&amp;gt;vla-object (ssname ss1 0))&lt;BR /&gt;ActSpace (if (= 0 (getvar "cvport"))&lt;BR /&gt;(vla-get-paperspace&lt;BR /&gt;(vla-get-activedocument (vlax-get-acad-object))&lt;BR /&gt;)&lt;BR /&gt;(vla-get-modelspace&lt;BR /&gt;(vla-get-activedocument (vlax-get-acad-object))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;StartPt (getpoint "\nPick location for point of arrow head: ")&lt;BR /&gt;txt (vla-get-TextString Textobj)&lt;/P&gt;&lt;P&gt;TextPt&lt;BR /&gt;(vla-get-insertionpoint textobj)&lt;BR /&gt;TextPt&lt;BR /&gt;(vlax-variant-value TextPt)&lt;BR /&gt;TextPt&lt;BR /&gt;(vlax-safearray-&amp;gt;list TextPt)&lt;BR /&gt;ptlist&lt;BR /&gt;(vlax-make-safearray&lt;BR /&gt;vlax-vbdouble&lt;BR /&gt;'(0 . 5)&lt;BR /&gt;)&lt;BR /&gt;ptlist&lt;BR /&gt;(vlax-safearray-fill ptlist (append StartPt TextPt))&lt;BR /&gt;MLObj&lt;BR /&gt;(vla-addmleader&lt;BR /&gt;ActSpace&lt;BR /&gt;ptlist&lt;BR /&gt;'LeaderIndex&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(vla-put-textstring mlobj txt)&lt;BR /&gt;(vla-delete Textobj)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error Code.PNG" style="width: 408px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/836279i387944548FCFB1C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error Code.PNG" alt="Error Code.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 10:54:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824165#M68521</guid>
      <dc:creator>rmordov</dc:creator>
      <dc:date>2020-10-26T10:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824180#M68522</link>
      <description>&lt;P&gt;Have you tried asking over in the LISP and Customization forum?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 10:57:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824180#M68522</guid>
      <dc:creator>RobDraw</dc:creator>
      <dc:date>2020-10-26T10:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824187#M68523</link>
      <description>&lt;P&gt;I am also new to trying to use the forums correctly... I will post over there now. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 10:59:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824187#M68523</guid>
      <dc:creator>rmordov</dc:creator>
      <dc:date>2020-10-26T10:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824422#M68524</link>
      <description>&lt;P&gt;Try adding (vl-load-com) before your code.&amp;nbsp; If that doesn't work, we'd need to know more about your setup (version, profile, recent reinstallation, computer type (PC vs MAC).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 12:51:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9824422#M68524</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2020-10-26T12:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827071#M68525</link>
      <description>&lt;P&gt;I think (vl-load-com) is already at the beginning of the code? The problem appears to be specific to this particular lisp (others I have on hand seem to work fine) I did do a reinstall a couple months ago but I have definitely used the lisp after that was complete. I'm using C3D 2020 but it's on a work computer (PC) so I'm not totally sure if any updates would have been done without my knowledge. Would an update be able to render the lisp inoperable?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:25:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827071#M68525</guid>
      <dc:creator>rmordov</dc:creator>
      <dc:date>2020-10-27T12:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827163#M68526</link>
      <description>&lt;P&gt;Actually (vl-load-com) isn't at the top of the code as you might think. Neither is the program being defun'ed as you might think. Given this code snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:mlte (/) (c:MLeaderToExistingtext))
(defun c:MLeaderToExistingtext (/)
(vl-load-com)
....&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The alias for the program, which is what you are probably using most of the time is being defined to execute a function that doesn't exist (unless it's been previously loaded).&amp;nbsp; The (vl-load-com) is nested into the long form of the user defined function, which is a horrible location.&amp;nbsp; If in doubt about whether Active-X functions have been loaded, put the (vl-load-com) statement outside any user defined function, preferably as the first statement of the lisp file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To be clearer,&lt;/P&gt;
&lt;P&gt;(defun c:mlte (/) (c:MLeaderToExistingtext))&lt;/P&gt;
&lt;P&gt;is equivalent to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun c:mlte (/) (function_doesn't_exist))&lt;/P&gt;
&lt;P&gt;IOW, it will cause an error immediately unless the file has been loaded before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always put aliases at the end of a file, never at the beginning.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:56:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827163#M68526</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2020-10-27T12:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827252#M68527</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5031365"&gt;@rmordov&lt;/a&gt;&lt;/P&gt;&lt;P&gt;For me, code worked instantly without any problem. In newer version (vl-load-com) is loaded at startup. It is not a problem if code tries to load it again, it won't run if already loaqded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't change a thing in a code, just localized variables and rearranged function calls. I hope it will work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vl-load-com)
(defun MLeaderToExistingtext (/ ss1 Textobj ActSpace StartPt txt TextPt ptlist MLObj ) 
	(cond
		;;Select the text/mtext objects
		((or (null (setq ss1 (ssget ":S" '((0 . "text,mtext"))))) (= 0 (setq ssl (sslength ss1))) ) nil) 		
		(T
			(setq
				Textobj (vlax-ename-&amp;gt;vla-object (ssname ss1 0))
				ActSpace 
					(if (= 0 (getvar "cvport"))
						(vla-get-paperspace
						(vla-get-activedocument (vlax-get-acad-object))
						)
						(vla-get-modelspace
						(vla-get-activedocument (vlax-get-acad-object))
						)
					)
				StartPt (getpoint "\nPick location for point of arrow head: ")
				txt (vla-get-TextString Textobj)

				TextPt (vla-get-insertionpoint textobj)
				TextPt(vlax-variant-value TextPt)
				TextPt (vlax-safearray-&amp;gt;list TextPt)
				ptlist(vlax-make-safearray vlax-vbdouble '(0 . 5)) 
				ptlist(vlax-safearray-fill ptlist (append StartPt TextPt))
				MLObj(vla-addmleader ActSpace ptlist 'LeaderIndex)
			)
			(vla-put-textstring mlobj txt)
			(vla-delete Textobj)
		)
	)
(princ)	
)
(defun c:mlte nil (MLeaderToExistingtext))
(defun c:MLeaderToExistingtex nil (MLeaderToExistingtext))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 13:35:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9827252#M68527</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2020-10-27T13:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9828702#M68528</link>
      <description>&lt;P&gt;As much as I infinitely respect your input, I think I have to disagree.&lt;/P&gt;
&lt;P&gt;Defining the shortcut before defining the long form should not cause a problem at all unless the shortcut is called before the long form is defined.&amp;nbsp; The shortcut won't call the long form until the shortcut is called.&lt;/P&gt;
&lt;P&gt;Now if he tried (setq c:this c:longthis) before c:longthis was defined, then yes, c:this is nil.&lt;/P&gt;
&lt;P&gt;Also, it shouldn't matter if vl-load-com is invoked after a function is defined.&amp;nbsp; It should matter only if a vl-* function were called before vl-load-com was invoked.&lt;/P&gt;
&lt;P&gt;BTW, I put vl-load-com near the top of every c: function.&amp;nbsp; It doesn't hurt to call it over and over and over again unless you are worried about losing a nanosecond or two during a day's work.&lt;/P&gt;
&lt;P&gt;Another BTW, you really don't want to (setq c:this c:longthis) because the memory used to store c:longthis is now doubled, whereas (defun c:this ()(c:longthis)) is next to nothing because it doesn't include the definition of c:longthis but only a call to it.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 00:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9828702#M68528</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-10-28T00:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829738#M68529</link>
      <description>&lt;P&gt;"Infinitly huh?"&amp;nbsp; Please tell my children.&lt;/P&gt;
&lt;P&gt;Thanks for the correction though.&amp;nbsp; You are very right - Interesting.&amp;nbsp; That's a good reason for not using setq unless you want to fix the program structure so the subfunctions can't be redefined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;So my logic and reasoning of why the OP's program didn't work doesn't hold water.&amp;nbsp; Wonder what the problem actually is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do know that the program will only work when the current mleader style doesn't have a content type of "block".&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 12:48:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829738#M68529</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2020-10-28T12:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829823#M68530</link>
      <description>&lt;P&gt;I'm gonna guess that your kids are no more kids than my kids are kids.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:17:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829823#M68530</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-10-28T13:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829847#M68531</link>
      <description>&lt;P&gt;Yep. My kids also have kids who don't listen to them either.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:22:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829847#M68531</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2020-10-28T13:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829880#M68532</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/411413"&gt;@dbroad&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;Wonder what the problem actually is.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For 99% the registry entries for that are broken.&lt;/P&gt;
&lt;P&gt;I send a private message yesterday &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5031365"&gt;@rmordov&lt;/a&gt; about a test and fix,&lt;/P&gt;
&lt;P&gt;but didn't get feedback until now about that is the case or not.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9829880#M68532</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-10-28T13:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Error- No Function Definition</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9830374#M68533</link>
      <description>I figure that in ten years or less I'll be Great Grandpa, but they do&lt;BR /&gt;listen to me.  My oldest daughter tries to negotiate with hers.  But as a&lt;BR /&gt;young coworker once told me, "Kids are like terrorists.  You can't&lt;BR /&gt;negotiate with terrorists!"</description>
      <pubDate>Wed, 28 Oct 2020 16:04:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-error-no-function-definition/m-p/9830374#M68533</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-10-28T16:04:35Z</dc:date>
    </item>
  </channel>
</rss>

