Jump to content

Re-entering Lisp


aloy

Recommended Posts

When I run a rouitine containing the following line I get the above message:

 
(setq ip(car (reverse lx)))
(setq pr(polar ip devx 400))
(command "_line" "_non" ip "_non" pr "")
(setq x(getpoint "\nGive nearest point to ip on curve"))
(setq del(abs b))
(setq a(/ del 2))

The value of devx has been calculaed by the routine previously.

It happens after the line has been drawn. What seems to be the problem?. The routine, hovever,goes on to evaluate the renainder and do what I need to do as intended. Also how can I show the values of variables such as minimum Radius, superelevation, lenght of spiral etc. all calculated for varius positions of x (as per local standards) in a table before I finally accept its position on the line?.

I shall be grateful for any help.

Link to comment
Share on other sites

In shown example nothing seems to point on re-entering lisp error...

 

If you want to make sure that (command) function has exit insert this line after (command "_line" "_non" ip "_non" pr)

(while (> (getvar 'cmdactive) 0) (command ""))

Link to comment
Share on other sites

Hi Marko_redar,

Thanks for the reply. It however does not work. Try it yourself with asigned values for lx and devx as follows:

 
(setq lx '((500 500)))
(setq devx 1.0)
(setq b 1)
(setq ip(car (reverse lx)))
(setq pr(polar ip devx 400))
(command "_line" "_non" ip "_non" pr "")
(while (> (getvar 'cmdactive) 0) (command ""))
(setq x(getpoint "\nGive nearest point to ip on curve"))
(setq del(abs b))
(setq a(/ del 2))

You need to set appropriate limits (say 0,0 and 1000, 900)

Link to comment
Share on other sites

You have to put your code inside function defined as command or non-command - my example is command function X

 

(defun c:x nil
(setq lx '((500 500)))
(setq devx 1.0)
(setq b 1)
(setq ip(car (reverse lx)))
(setq pr(polar ip devx 400))
(command "_line" "_non" ip "_non" pr)
(while (> (getvar 'cmdactive) 0) (command ""))
(setq x (getpoint "\nGive nearest point to ip on curve"))
(setq del (abs b))
(setq a (/ del 2))
)

 

Now, paste code or load it with appload, and type X to execute... There is no error message...

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