aloy Posted July 16, 2012 Share Posted July 16, 2012 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. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted July 16, 2012 Share Posted July 16, 2012 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 "")) Quote Link to comment Share on other sites More sharing options...
aloy Posted July 16, 2012 Author Share Posted July 16, 2012 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) Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted July 17, 2012 Share Posted July 17, 2012 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... Quote Link to comment Share on other sites More sharing options...
aloy Posted July 17, 2012 Author Share Posted July 17, 2012 Thanks marko it works. Now I want it to work inside my code without having to type x. Regards Quote Link to comment Share on other sites More sharing options...
aloy Posted July 19, 2012 Author Share Posted July 19, 2012 Hi Marko, Thanks again, it works inside the routine. Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.