TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Kate M 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. :-))
-
email me the dwg, i'll do it.
mark.thomas@tampagov.net
-
Mark, you've got too much time on your hands .. first a batch of DGN's then ..
Is that guy helpful or what?
-
Hmm...not sure I'm allowed...thanks, though. :-) I thought TCOUNT might be work, but you have to use numbers.
-
Find/replace maybe?
-
Could work, but there's a bunch of different sizes -- probably still faster than typing it all in individually. :-)
-
anything common with all the text?
-
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.
-
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:
(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)
)
-
Don't know where I got "(22)" from .. hmm :roll: .. should've been " (E)" I see.
-
Try this and use zero as the increment.
AutoNumb (http://www.theswamp.org/lilly.pond/index.php?subdir=Text%20Increment&sortby=name&msg=%3Cp%20class%3Dinfo%3EUpload%20of%20file%20autonumb_v2.zip%20succeeded0)
-
If the text to be changed are AISC beam designations,
try this routine or tweaked it to your needs:
(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)
)
-
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