muthu123 Posted June 20, 2010 Share Posted June 20, 2010 Please help in this issue. (read (strcat "(" "TUBE150X150X4.5 20.2" ")")) it returns a list (TUBE150X150X4 20.2). But I need a list (TUBE150X150X4.5 20.2) including decimal point. Yours, Muthu. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 Hi. Give this a try. (read (strcat " " TUBE150X150X4.5 20.2 " ")) Regards, Tharwat Quote Link to comment Share on other sites More sharing options...
muthu123 Posted June 20, 2010 Author Share Posted June 20, 2010 Hi. Give this a try. (read (strcat " " TUBE150X150X4.5 20.2 " ")) Regards, Tharwat Not working. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 Here it goes very well. load the file and type abc to start; (defun c:abc (/ a b c d e f g tharwat pt) (setq a "TUBE" b "150" c "X" d "150" e "X" f "4.5" g "20.2") (setq tharwat (strcat "(" a b c d e f " " g ")")) (if (setq pt (getpoint "\nSpecify placement point: ")) (entmake (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 10 (trans pt 1 0)) (cons 1 tharwat) ) ) ) (princ) ) The outcome is (TUBE150X150X4.5 20.2) Enjoy. Tharwat Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 20, 2010 Share Posted June 20, 2010 I think what you need is strcat chr(x) "TUBE150X150X4.5" "20.2" chr(y) The correct value for x as an example 13 is Carriage return 32 is space you can basicly replace any keyboard character with a number value I wrote years ago an asc lisp that gave me the number as I pressed a key. Big hints look for HELP asc & chr in lisp help Sorry could not find asc.lsp also known as asci key codes. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 I think what you need is strcat chr(x) "TUBE150X150X4.5" "20.2" chr(y) The correct value for x as an example 13 is Carriage return 32 is space you can basicly replace any keyboard character with a number value I wrote years ago an asc lisp that gave me the number as I pressed a key. Big hints look for HELP asc & chr in lisp help Sorry could not find asc.lsp also known as asci key codes. Hi. If you would give us an example, that would be much better..... Tharwat Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 Hello muthu123 Today is your lucky day man ... my ideas are burning up promptly today. Check this out, it is as best as the previous one. (defun c:abc (/ a pt) (setq a "(TUBE150X150X4.5 20.2)") (if (setq pt (getpoint "\nSpecify placement point: ")) (entmake (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 10 (trans pt 1 0)) (cons 1 a) ) ) ) (princ "Cad Tutor Forum is the best") (princ)) regards Tharwar Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 So finally. The main problem is within the function 'read' because it doesn't except decimal number or couldn't deal with it . Hope that was helpful and enough . Tharwat Syria Quote Link to comment Share on other sites More sharing options...
VVA Posted June 20, 2010 Share Posted June 20, 2010 So finally. The main problem is within the function 'read' because it doesn't except decimal number or couldn't deal with it . Hope that was helpful and enough . Tharwat Syria so satisfied? (read (strcat "(" [b][color="Red"]"\""[/color][/b] "TUBE150X150X4.5" [b][color="Red"]"\""[/color][/b] "20.2" ")")) return ("TUBE150X150X4.5" 20.2) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 so satisfied? (read (strcat "(" [b][color="Red"]"\""[/color][/b] "TUBE150X150X4.5" [b][color="Red"]"\""[/color][/b] "20.2" ")")) return ("TUBE150X150X4.5" 20.2) It is differ than the required. try it with brackets ...... :wink: I would like to see it come true . Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 20, 2010 Share Posted June 20, 2010 so satisfied ? (read (strcat "(" [b][color="Red"]"\""[/color][/b] "TUBE150X150X4.5" [b][color="Red"]"\""[/color][/b] "20.2" ")")) return ("TUBE150X150X4.5" 20.2) These quotaion marks are should not be included. so try it another way... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 21, 2010 Share Posted June 21, 2010 Further to what I was suggesting this is from Autocad lisp help sometimes you need spaces and slashes but not as keyboard which stops code from running Command: (chr 65) "A" (chr 66) "B" (chr 97) "a" Likewise the opposite Command: (ascii "A") 65 Command: (ascii "a") 97 Command: (ascii "BIG") 66 40=( 41=) 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.