AbdRF Posted August 5, 2019 Share Posted August 5, 2019 Hi all, I am learning lisp programming.Here is the code which I am a trying to run (defun c:tex (/ p1 a b c d e f) (setq pl (getpoint "\nStarting point: ")) (setq a (getdist p1 "\nEnter height: ")) (setq c (getdist p1 "\nline spacing: ")) (setq d "T") (while d (setq e (getstring 1 "Text: ")) (command "text" pl a "0" e) (setq pl (list (car p1)(- (cadr p1) c))) (setq f (getstring)) (if (= f "*")(setq d nil)) ) (princ) ) I am getting the below error.Can somebody explain me ? Quote Starting point: ; error: bad argument type: point: nil Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted August 5, 2019 Share Posted August 5, 2019 You have a variable pl (PL) and a variable p1 (P one). Quote Link to comment Share on other sites More sharing options...
David Bethel Posted August 5, 2019 Share Posted August 5, 2019 You may want to look into (initget) call prior to (get.... ) calls. -David (defun c:foo (/ p1 a c) (initget 1) (setq p1 (getpoint "\nStarting Point: ")) (initget 6) (setq a (getdist p1 (strcat "\nTEXT Height <" (rtos (getvar "TEXTSIZE") 2 2) ">: "))) (or a (setq a (getvar "TEXTSIZE"))) (setvar "TEXTSIZE" a) (initget 7) (setq c (getdist p1 "\nLine Spacing": "))) ...) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 6, 2019 Share Posted August 6, 2019 (edited) My $0.05 using a library routine. If ran again both variables can be set to update. (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq ans (AH:getvalsm (list "Enter values" "Text height" 5 4 (rtos (getvar "textsize")) "Line spacing " 5 4 "1" ))) Edited August 6, 2019 by BIGAL Quote Link to comment Share on other sites More sharing options...
AbdRF Posted August 7, 2019 Author Share Posted August 7, 2019 On 8/5/2019 at 12:53 PM, Roy_043 said: You have a variable pl (PL) and a variable p1 (P one). Oh that was so silly on my part. Thanks Quote Link to comment Share on other sites More sharing options...
AbdRF Posted August 7, 2019 Author Share Posted August 7, 2019 (edited) On 8/5/2019 at 3:35 PM, David Bethel said: You may want to look into (initget) call prior to (get.... ) calls. -David (defun c:foo (/ p1 a c) (initget 1) (setq p1 (getpoint "\nStarting Point: ")) (initget 6) (setq a (getdist p1 (strcat "\nTEXT Height <" (rtos (getvar "TEXTSIZE") 2 2) ">: "))) (or a (setq a (getvar "TEXTSIZE"))) (setvar "TEXTSIZE" a) (initget 7) (setq c (getdist p1 "\nLine Spacing": "))) ...) Sure David,will try this out . Cheers Edited August 7, 2019 by AbdRF 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.