Jump to content

Afralisp tutorial #1 driving me BONKERS


skipsophrenic

Recommended Posts

Hi all,

 

I've been reading up on .LISP for a bit now and decided to take the

plunge properly and learn it.

 

I have followed the afralisp tutorial to draw a line to the LETTER, and

AutoCAD is saying "; error: too many arguments"

 

What am i doing wrong?

 

(defun c:testline () 
;Define Function
(setq a (getpoint "\nEnter First Point : ""))
;Get the First point
(setq b (getpoint "\nEnter Second Point : ""))
;Get the Second Point
(command "Line" A b "")
;Draw the Line
(princ)
;clean running
) ;end Defun
(princ)
;clean Loading

Link to comment
Share on other sites

SORTED

........................................................................

Original Code with error's

 

(defun c:testline () 
;Define Function
(setq a (getpoint "\nEnter First Point : [color=red]""[/color]))
;Get the First point
(setq b (getpoint "\nEnter Second Point : [color=red]""[/color]))
;Get the Second Point
(command "Line" A b "")
;Draw the Line
(princ)
;clean running
) ;end Defun
(princ)
;clean Loading

 

code with error Fixed.

 

(defun c:testline () 
;Define Function
(setq a (getpoint "\nEnter First Point : [color=red]"[/color]))
;Get the First point
(setq b (getpoint "\nEnter Second Point : [color=red]"[/color]))
;Get the Second Point
(command "Line" A b "")
;Draw the Line
(princ)
;clean running
) ;end Defun
(princ)
;clean Loading

Link to comment
Share on other sites

(defun c:testline () 
;Define Function
[color="Red"] (setq a (getpoint "\nEnter First Point : "))[/color]
;Get the First point
[color="Red"] (setq b (getpoint "\nEnter Second Point : "))[/color]
;Get the Second Point
(command "Line" A b "")
;Draw the Line
(princ)
;clean running
) ;end Defun
(princ)
;clean Loading

 

An extra quot marks in red lines in your code

Link to comment
Share on other sites

From this error im assuming you are not using any program to play with them,

i use notpad ++ to make them. its good to see where ive got closed brackets and will run any where.

 

or

 

"_vlide"

 

Which is similar except colours are different, but allows to debug alot easyer, as it tells you where simple mistakes are, and easyer filtering where the bigger mistakes are. and reconises comands and variables

but you need autocad open to make work.

Link to comment
Share on other sites

I've decided to try learn it when i get free time at work (Which at moment is alot) so as to keep me "looking busy" LOL,

Link to comment
Share on other sites

yep i kno what you mean.ive being working on many myself, till more work comes in,except my boss thinks its a waste of time.

hes a all tool bars man, who dosnt even do much work lol

Link to comment
Share on other sites

I never liked toolbars they take up to much screen space as for auto lisp have you looked at the The Visual LISP Developers Bible? pretty good stuff .a little hard to keep up for slow people like. me but it's worth it. everyone on here would agree i'm sure

Link to comment
Share on other sites

so do you direct type into notepad then lee?

 

No, I used to, but now I use Visual LISP Editor (provided with ACAD), just type "vlide" in the command prompt to access it. :thumbsup:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...