Looking for a way, whether within AutoCAD or thru Autolisp or VBA, to individually edit text that has been grouped. Ungrouping and regrouping is too cumbersome. Search and replace will work, but will change all instances of text that match the serach/replace criteria.
Any suggestions?
Hi ,
What is the name of the group and what is the text string inside of it that you want to replace with another ?
Tharwat
The name of the group is TMPnn, where nn is a number. I create groups with a lisp program which assigns the next TMPnn to it.
As for the string, I am not looking for search and replace, but the abiliity to edit the text. Within these groups there is usually similar text that using a search/replace algorithm will replace everything, which is not what I am looking for.
I have a lisp program that allows the user to select multiple text, which then copies them to a text file, opens NOTEPAD, allows me to edit any text, then update the text back to AutoCAD.
Looking for something similar where if I select a group, it will write all text (TEXT,DTEXT,MTEXT, ATTRIBUTES) to NOTEPAD, allow me to edit what I want, then update all text within the group, without ever exploding the group.
DEMO:
(defun c:demo (/ etype)
(vl-load-com)
(vlax-for
itm (vla-get-groups (vla-get-ActiveDocument
(vlax-get-acad-object)))
(if (wcmatch (strcase (vla-get-name itm)) "TMP*")
(vlax-for
ob itm
(setq etype (vla-get-ObjectName ob))
(cond
((member etype
'("AcDbMText" "AcDbText"))
(princ
"\nDo this on TEXT entties/call your program here"))
((and (eq etype
"AcDbBlockReference")
(eq (vla-get-HasAttributes
ob)
:vlax-true))
(princ
"\nDo this on ATTRIBUTE entties/call your program here"))
)
)
)
)
(princ)
)
You said:
I have a lisp program that allows the user to select multiple text, which then copies them to a text file, opens NOTEPAD, allows me to edit any text, then update the text back to AutoCAD.
HENCE:
Do this on TEXT entties/call your program here
Do this on ATTRIBUTE entties/call your program here
HTH