alanjt Posted August 24, 2010 Posted August 24, 2010 Understood; I didn't mean to dig at you, or your code for that matter... Besides, it's still a 'purty LISP, Alan (insert inside joke here). [edit] Hah! That's twice in two forums, in a single day! This one just happens to be a bit more 'twangy. [/edit] No worries at all. Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 Hello everyone. Now my routine is working good BUT, when I chose m for Me it changes the strcase of the chars to ME and I wanted Me (setq num 0) (initget "I U [color="red"]Me[/color]") (setq str (getkword "\n Get Someone [i,U,[color="red"]Me[/color]]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (if (= str m) (setq txt (strcat [color="red"](setq m "Me")[/color] (rtos num 2 0))) (setq txt (strcat (strcase str) (rtos num 2 0))) ) (entmakex (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 txt) (cons 10 (trans pt 1 0)) ) )) Please help me with it GUYS. Regards. Quote
Lt Dan's legs Posted August 25, 2010 Posted August 25, 2010 [color=red](setq txt (strcat str (rtos num 2 0)))[/color] Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 [color=red](setq txt (strcat str (rtos num 2 0)))[/color] I am sorry ' date=' that's wrong. Because the outcome would be [b']ME1[/b] and I wanted Me1 Thanks. Quote
Lt Dan's legs Posted August 25, 2010 Posted August 25, 2010 try this (defun C:TEST (/ num str pt) (setq num 0) (initget "I U Me") (setq str (getkword "\n Get Someone [i,U,Me]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (entmakex (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 (strcat str (rtos num 2 0))) (cons 10 (trans pt 1 0)) ) ) ) (princ) ) Quote
lpseifert Posted August 25, 2010 Posted August 25, 2010 works for me... $ (strcat "Me" (rtos 1 2 0)) "Me1" _$ (setq str "Me") "Me" _$ (setq num 1) 1 _$ (strcat str (rtos num 2 0)) "Me1" _$ Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 try this (defun C:TEST (/ num str pt) (setq num 0) (initget "I U Me") (setq str (getkword "\n Get Someone [i,U,Me]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (entmakex (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 (strcat str (rtos num 2 0))) (cons 10 (trans pt 1 0)) ) ) ) (princ)) Waw Great work man. Thank you sooooo much. I do appreciated. Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 works for me... $ (strcat "Me" (rtos 1 2 0)) "Me1" _$ (setq str "Me") "Me" _$ (setq num 1) 1 _$ (strcat str (rtos num 2 0)) "Me1" _$ Thank you so much for your help. In your example I shall use the COND function to let that result appear . Can you use them in my previous routine please ? Best regards. Quote
Lt Dan's legs Posted August 25, 2010 Posted August 25, 2010 to Sweety, for your If argument. (if (eq str "M") (setq txt (strcat str (rtos num 2 0))) (setq txt "Why not Me??") ) Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 try this (defun C:TEST (/ num str pt) (setq num 0) (initget "I U Me") (setq str (getkword "\n Get Someone [i,U,Me]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (entmakex (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 (strcat str (rtos num 2 0))) (cons 10 (trans pt 1 0)) ) ) ) (princ)) Can I ask you why the STRCAT function did not use the upper case of Chars. but when it used alone it would make texts in upper case ??????? Thank you again and again. Sweety. Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 to Sweety' date=' for your If argument. (if (eq str "M") (setq txt (strcat str (rtos num 2 0))) (setq txt "Why not Me??")) [/quote'] FANTASTIC . my problem was with testing the string . here is a small correct example after you put me on the right rail. (setq num 0) (initget "I U Me") (setq str (getkword "\n Get Someone [i,U,Me]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (if (eq str "Me") (setq txt (strcat str (rtos num 2 0))) (setq txt "Why not Me?? ") ) (command "_.text" pt "" "" txt)) Thanks. Quote
Lt Dan's legs Posted August 25, 2010 Posted August 25, 2010 Don't know why I didn't notice this until now... (defun C:TEST (/ num str pt) (setq num 0) (initget "I U Me") (setq str (getkword "\n Get Someone [i,U,Me]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (entmakex (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 (strcat str ([color=red][b]itoa[/b][/color] num))) (cons 10 (trans pt 1 0)) ) ) ) (princ) ) Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 You make my day Lt Dan's legs Thanks for the Answers and Lisp site as well .. You are awesome Honey. Quote
Lee Mac Posted August 25, 2010 Posted August 25, 2010 Can I ask you why the STRCAT function did not use the upper case of Chars. but when it used alone it would make texts in upper case ??????? Thank you again and again. Sweety. You used 'strcase' in your earlier example. Quote
Sweety Posted August 25, 2010 Author Posted August 25, 2010 Hello everyone. Now my routine is working good BUT, when I chose m for Me it changes the strcase of the chars to ME and I wanted Me (setq num 0) (initget "I U Me") (setq str (getkword "\n Get Someone [i,U,Me]:") ) (while (setq pt (getpoint "\n Get XYZ points :")) (setq num (1+ num)) (if (= str m) (setq txt (strcat (setq m "Me") (rtos num 2 0))) (setq txt (strcat [color="blue"](strcase str)[/color] (rtos num 2 0))) ) (entmakex (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 txt) (cons 10 (trans pt 1 0)) ) )) That's right Mr.LEE. But I couldn't include the (Me) in a text without being in capital letter, So Mr.Lt Dan did a very great work for me and solved the issue nicely . Thank you for writting. Sweety Quote
Lee Mac Posted August 25, 2010 Posted August 25, 2010 The getkword function will return the string as specified in the initget statement whatever the user types, so no strcase is needed Quote
alanjt Posted August 25, 2010 Posted August 25, 2010 (setq num 0) (initget 0 "I U Me") (if (setq str (getkword "\nGet someone [i/U/Me]: ")) (while (setq pt (getpoint "\n Get XYZ points :")) (entmake (list '(0 . "TEXT") (cons 40 (getvar 'textsize)) (cons 1 (strcat str (rtos (setq num (1+ num)) 2 0))) (cons 10 (trans pt 1 0)) ) ) ) ) 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.