bdw_at_TDE Posted September 28, 2012 Posted September 28, 2012 Hi, I'm creating a autolisp routine for drawing ducts. i want to select a point or type in a string with (setq x (getstring "/nPick second point or place transition[T])) it does nothing when i pick a point on screen with (setq p2 (getpoint "/nPick second point or place transition[T])) it gives me "Invalid point." can i do something with this (error handeling) or has anybody have a different work-around Quote
Lee Mac Posted September 28, 2012 Posted September 28, 2012 When using getpoint, what are you entering at the prompt for the function to return 'Invalid point.'? Quote
bdw_at_TDE Posted September 28, 2012 Author Posted September 28, 2012 My english is not so good. so I hope i understand your question correctly. I type "T" but because autocad is expecting a point it returns "Invalid point" Quote
pBe Posted September 28, 2012 Posted September 28, 2012 (initget 1 "T") (setq p2 (getpoint "/nPick second point or place transition[T]")) ?? Quote
pBe Posted September 28, 2012 Posted September 28, 2012 Yes thanks Good for you, Welcome to CADTutor Quote
BIGAL Posted September 29, 2012 Posted September 29, 2012 Maybe press enter then point is nil this way you do not mix variables as points or strings (setq x (getpoint "/nPick second point or place transition <Cr>)) (if (= x nil) do something now Quote
bdw_at_TDE Posted October 1, 2012 Author Posted October 1, 2012 (edited) (setq sp (getpoint "\nGive startpoint: ")) (while (initget "v t") (setq np (getpoint sp"\nGive next point, transition(v) or tee(t)")) (if (= np "v") (transition) ) (if (= np "t") (tee) ) (duct) ) this piece of code works without the while loop. with the while loop it stops on the initget function. anybody knows why that is? Edited October 1, 2012 by bdw_at_TDE not completed Quote
Stefan BMR Posted October 1, 2012 Posted October 1, 2012 initget always returns nil, so (while is stop working. Try (while (progn (initget "v t") (setq np (getpoint sp"\nGive next point, transition(v) or tee(t)")) ) ...... Quote
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.