viriato79 Posted July 10, 2007 Share Posted July 10, 2007 I have several text lines (by command TEXT) and I want to replace a word in all existing text lines. I´m editing one by one and replace that word manually. How can I do that automatically? Thanks Quote Link to comment Share on other sites More sharing options...
tzframpton Posted July 10, 2007 Share Posted July 10, 2007 easy, type FIND at the command line. from there it should be pretty self explanatory. Quote Link to comment Share on other sites More sharing options...
dtkell Posted July 10, 2007 Share Posted July 10, 2007 If you have to replace the same text string in each of the existing dtext entities, do a search for "chgtext.lsp". If it's mtext, you need to use find and replace. The lsp lets you replace all instances of a text string in selected dtext with the new replacement in all instances selected. Quote Link to comment Share on other sites More sharing options...
gil9166 Posted August 5, 2009 Share Posted August 5, 2009 easy, type FIND at the command line. from there it should be pretty self explanatory. yes you were right it is to find, but i could not replace nor add same letter on each attribute on individual blocks, ex. block one has an attribute of "1", block two has "2", block three has "3" and so on, I want is to add same letter on each attribute like on block one should be "P1", block two should be "P2", block three shoulb be "P3" and so on at the same time like when you are using "find and replace". Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 5, 2009 Share Posted August 5, 2009 This can easily be done using LISP. I'll get back to you on it Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 5, 2009 Share Posted August 5, 2009 For example: (defun c:frblk (/ ss sel) (vl-load-com) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (progn (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)))) (foreach att (vlax-invoke Obj 'getAttributes) (if (vl-every (function (lambda (x) (< 47 x 58))) (vl-string->list (vla-get-TextString att))) (vla-put-TextString att (strcat "P" (vla-get-TextString att)))))) (vla-delete sel)) (princ "\n** Nothing Selected **")) (princ)) 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.