Jump to content

Choose multiple text items on a drawing, then edit each one


tarment

Recommended Posts

In the earlier versions (2000) we were able to take a P&ID, choose about 7 different text items, (cue them up), and then perform the edit on each one after choosing. It was TEDIT we were using and I can't remember what was done to allow this. This was set up for text only edit. We have not been able to mirror this in 2012. The closest command is DDEDIT which allows us to choose, change, choose, change. Would like to be able to choose, choose, choose, change, change, change.

 

Thanks in advance for any recommendations!

Link to comment
Share on other sites

Welcome to CADTutor!

 

Give this a try:

 

(defun c:TEDIT ( / ss)
 (if (setq ss (ssget "_:L" '((0 . "MTEXT,TEXT"))))
   ((lambda (i / e)
      (while (setq e (ssname ss (setq i (1+ i))))
        (if (= "MTEXT" (cdr (assoc 0 (entget e))))
          (command "._mtedit" e)
          (command "._ddedit" e ""))))
     -1)
   (prompt "\n** Nothing selected ** "))
 (princ))

Edit - This is for MText only selection, let me know if that is an issue. Code revised to allow MText, and Text selection/manipulation.

Link to comment
Share on other sites

ddedit command call works on mtext also ;)

 

That it does, but I can't get it to work on multiple Text items with differing content. Maybe because of a system variable setting on my machine.

Link to comment
Share on other sites

(defun c:TEdit (/ ss i)
 (if (setq ss (ssget "_:L" '((0 . "ATTDEF,MTEXT,MULTILEADER,TEXT"))))
   (repeat (setq i (sslength ss)) (command "_.ddedit" (ssname ss (setq i (1- i))) ""))
 )
 (princ)
)

Link to comment
Share on other sites

Would you please explain the status a little bit more ?

 

In DDEDIT (the stock command) you can select multiple MTEXTs, click into the contents box in properties, and cycle through a selection set of them, assigning different values to each one, in turn. With a selection of TEXT items in the same situation, you can assign all of them the same value, but I don't believe that you can cycle through them, as you can with the MTEXT items. I don't have any need of this, just remarking, as I took that to be what the OP was hoping for. I see that alanjt seems to have stepped into the void, and presumably will have delivered a satisfactory solution for the OP.

Link to comment
Share on other sites

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