Author Topic: Adding a suffix to text  (Read 4873 times)

0 Members and 1 Guest are viewing this topic.

Kate M

  • Guest
Adding a suffix to text
« on: February 20, 2004, 10:30:56 AM »
I need to add " (E)" to about 200 beam designations -- they're all just single line text...any takers? :-) (This isn't really urgent, I'm just being lazy. :-))

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Adding a suffix to text
« Reply #1 on: February 20, 2004, 10:50:01 AM »
email me the dwg, i'll do it.
mark.thomas@tampagov.net
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
Adding a suffix to text
« Reply #2 on: February 20, 2004, 11:00:26 AM »
Mark, you've got too much time on your hands .. first a batch of DGN's then ..

Is that guy helpful or what?

Kate M

  • Guest
Adding a suffix to text
« Reply #3 on: February 20, 2004, 11:03:24 AM »
Hmm...not sure I'm allowed...thanks, though. :-) I thought TCOUNT might be work, but you have to use numbers.

SMadsen

  • Guest
Adding a suffix to text
« Reply #4 on: February 20, 2004, 11:10:18 AM »
Find/replace maybe?

Kate M

  • Guest
Adding a suffix to text
« Reply #5 on: February 20, 2004, 11:14:13 AM »
Could work, but there's a bunch of different sizes -- probably still faster than typing it all in individually. :-)

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Adding a suffix to text
« Reply #6 on: February 20, 2004, 11:27:57 AM »
anything common with all the text?
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
Adding a suffix to text
« Reply #7 on: February 20, 2004, 11:30:00 AM »
You do know that you can select all the objects you want to replace? Seems like the long way, but it is still quicker than selecting each object then locating the spot, then typing the change. Which can get annoying real quick.

SMadsen

  • Guest
Adding a suffix to text
« Reply #8 on: February 20, 2004, 12:29:37 PM »
Oh well, forgot find/replace doesn't take wildcards. Sorry.

Here you go (change the "(22)" text to any suffix you want) - single line text only:
Code: [Select]
(defun C:go22 ()
  (cond ((setq sset (ssget '((0 . "TEXT"))) a 0)
         (while (setq ent (ssname sset a))
           (setq entl (entget ent) a (1+ a))
           (entmod (subst (cons 1 (strcat (cdr (assoc 1 entl)) "(22)"))
                          (assoc 1 entl)
                          entl)
  ))))
  (princ)
)

SMadsen

  • Guest
Adding a suffix to text
« Reply #9 on: February 20, 2004, 12:31:54 PM »
Don't know where I got "(22)" from .. hmm  :roll: .. should've been " (E)" I see.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Adding a suffix to text
« Reply #10 on: February 20, 2004, 12:43:02 PM »
Try this and use zero as the increment.

AutoNumb
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

DParcon

  • Guest
Adding a suffix to text
« Reply #11 on: February 20, 2004, 01:21:16 PM »
If the text to be changed are AISC beam designations,
try this routine or tweaked it to your needs:

Code: [Select]


(defun C:CHT ()
  (if (setq ss (ssget '((0 . "TEXT") (1 . "*X*"))))
    (while (setq e (ssname ss 0))
      (setq str (cdr (assoc 1 (setq ed (entget e))))
            str (strcat str "(E)")
      )
      (entmod (subst (cons 1 str) (assoc 1 ed) ed))
      (entupd e)
      (ssdel e ss)  
    );while
    (prompt "No Text to be changed..")
  )
  (princ)
)


Kate M

  • Guest
Adding a suffix to text
« Reply #12 on: February 20, 2004, 04:39:31 PM »
I ended up just using find/replace, first to find all the different sizes, then to tack on the suffix -- but I'll definitely try out some of the code suggestions for the next time I forget to label all the existing beams. :-)

Thanks again for all the ideas!

-Kate