Jump to content

Recommended Posts

Posted

Hi friends

Can you pls provide me a lips for following

1) rename my Drawing no from 001-5020

to MUP-001-5050

 

2) rename my drawing no MUP-001-5050 To 001-5050

 

in first lips just add MUP-

In second just replace MUP-

 

Thanks

Posted

Did you mean rename the title or rename the file ?

Posted

Thanks mostafa

 

i mean the rename the text within in the drawing only..

rename the text with MUP-

 

 

 

Did you mean rename the title or rename the file ?
Posted
Thanks mostafa

 

i mean the rename the text within in the drawing only..

rename the text with MUP-

What about find and replace?

Posted

i wish to done this by lips, bz i have to repeat this every drawing

Posted

Thank you

there is any lips , when i click on the text and it will automatically rename in to by adding "mup"+ current text

Posted
(defun c:SwitchTxt ( / enm obj str)
 (if
   (and
     (setq enm (car (nentsel)))
     (setq obj (vlax-ename->vla-object enm))
     (vlax-property-available-p obj 'textstring)
   )
   (vla-put-textstring
     obj
     (if (wcmatch (strcase (setq str (vla-get-textstring obj))) "MUP-*")
       (substr str 5)
       (strcat "MUP-" str)
     )
   )
 )
 (princ)
)

Posted
Thank you

there is any lips , when i click on the text and it will automatically rename in to by adding "mup"+ current text

Ok try this.

(defun C:addmup ( / END ENT I SSET TXT)
 (setq sset (ssget '((0 . "*TEXT"))))
 (setq i (sslength sset))
 (while (not (minusp (setq i (1- i))))
   (setq ent (ssname sset i)
     end (entget ent)
     txt (cdr (assoc 1 end))
     end (subst(cons 1(if (strcat txt )(strcat "MUP-" txt)))
          (assoc 1 end) end))
   (entmod end)
 )
(princ)
)

Posted

Excellent :D:D:D it works

how you learn this lips , i am using many lips, but all of them got contributed good people like you :)

when i will learn to make some lips :P

Posted
Ok try this.
(defun C:addmup ( / END ENT I SSET TXT)
 (setq sset (ssget '((0 . "*TEXT"))))
 (setq i (sslength sset))
 (while (not (minusp (setq i (1- i))))
   (setq ent (ssname sset i)
     end (entget ent)
     txt (cdr (assoc 1 end))
     end (subst(cons 1(if (strcat txt )(strcat "MUP-" txt)))
          (assoc 1 end) end))
   (entmod end)
 )
(princ)
)

 

 

icon7.gif

 

Excellent
:D
:D:D it works

how you learn this lips , i am using many lips, but all of them got contributed good people like you
:)

when i will learn to make some lips
:P

Posted

Thank you roy :D , its working fine with me now, thank for your good heart

Posted

Copy "001-500" to clipboard using Ctrl+C , FIND Ctrl+V in Replace MUP then Ctrl V replace ALL no need for code. Its an alternative method.

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