Jump to content

Lisp Newbie


KennethYeoh

Recommended Posts

I was just following the tutorial and i realised that i could not load the testline lisp. AutoCad states [; error:too many arguments ]? I have tried everythin i could think of to no avail. It would be very helpful if someone could shine some light on this issue.

 

Regards

Kenneth

Link to comment
Share on other sites

(defun c:testline()
(setq a (getpoint "\nEnter first point :" ))
(setq b (getpoint "\nEnter second point :" ))
(command "Line" a b "")
(princ)
)
(princ)

I think i followed all the instructions to the letter

I used (load "testline") then testline to launch. i'm sure its somethin really simple and obvious???? Gladly consider all feedback! thanks!

Link to comment
Share on other sites

Your code is working! So there is an issue with load/call process.

Where is the "testline.lsp" file located?

If is not in one of AutoCAD's search paths you should append the path to load call - please take care that need to use double back-slash. Substitute your current path in example below:

 

(load "D:\\MyTestAutoLISP\\testline.lsp")

 

To call it just input testline at command prompt since is defined as a command.

Good luck!

 

Regards,

Mircea

Link to comment
Share on other sites

Your code is working! So there is an issue with load/call process.

Where is the "testline.lsp" file located?

If is not in one of AutoCAD's search paths you should append the path to load call - please take care that need to use double back-slash. Substitute your current path in example below:

 

(load "D:\\MyTestAutoLISP\\testline.lsp")

 

To call it just input testline at command prompt since is defined as a command.

Good luck!

 

Regards,

Mircea

 

There's still an error? Says LOAD failed =( I saved the lisp file on the desktop.

Link to comment
Share on other sites

Scratch that, i have suceeded in loading the file, but when i call the program using testline it states that there is stil an error and that there are too many arguments?

Link to comment
Share on other sites

Sound good that you finally solved your loading issue. Did you stored in the same file some previous code tests?

 

Regards,

Mircea

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...