Jump to content

Recommended Posts

Posted
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). :P

 

[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.
  • Replies 36
  • Created
  • Last Reply

Top Posters In This Topic

  • Sweety

    11

  • BlackBox

    8

  • Lee Mac

    6

  • Lt Dan's legs

    5

Top Posters In This Topic

Posted

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.

Posted
      [color=red](setq txt (strcat str (rtos num 2 0)))[/color]

Posted
      [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.:)

Posted

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)
)

Posted

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"
_$ 

Posted
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.

Posted
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.

Posted

to Sweety,

 

for your If argument.

 

 
(if (eq str "M")
 (setq txt (strcat str (rtos num 2 0)))
 (setq txt "Why not Me??")
)

Posted
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.

Posted
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 . :D

 

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.

Posted

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)
)

Posted

You make my day Lt Dan's legs

 

Thanks for the Answers and Lisp site as well .. :thumbsup:

 

You are awesome Honey.

Posted
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.

Posted
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

Posted

The getkword function will return the string as specified in the initget statement whatever the user types, so no strcase is needed :)

Posted
(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))
            )
   )
 )
)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...