TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: brennon on December 21, 2004, 03:41:40 PM
-
Hello :D
I am learning lisp and this may sound like a dumb question. Sorry in advance!!
I am trying to create a very basic lisp routine. When I try to load the lisp through the Visual LISP editor, I get the following error:
_$
Error: malformed list on input :x
_$
When I try to load it by typing (load "plmt") at the command line I get an error aswell.
I know that I am missing something or somethings. What is it that I missed?
The basic lisp routine is below.
(defun c: plmt ()
;Measure the Distance between 2 points
(setq a (getpoint "\nEnter First Point : "))
;get the first point
(setq b (getpoint "\nEnter Second Point : "))
;get second point
(command "dist" a b "")
;measure the distance
;end defun
Thanks for the help in advance!!
-
No space after the C: in the defun statement...no "" after the a b in the distance command (the "" causes a repeat of the command)...and missing the closing ) for the defun...
EDIT: added a (princ) to exit quietly...
(defun c:plmt ()
;Measure the Distance between 2 points
(setq a (getpoint "\nEnter First Point : "))
;get the first point
(setq b (getpoint "\nEnter Second Point : "))
;get second point
(command "dist" a b)
;measure the distance
(princ)
);end defun
-
Thanks Dommy2Hotty
It worked great
-
Thanks Dommy2Hotty
It worked great
Glad I could help...makes me feel like I know something... :lol: