Author Topic: Add prefix to text  (Read 2061 times)

0 Members and 1 Guest are viewing this topic.

danny

  • Guest
Add prefix to text
« on: June 30, 2005, 04:48:28 PM »
I know I've seen a lisp that will do this..just can't seem to find it.  Can someone lead the way...
thanks, :?

hyposmurf

  • Guest
Add prefix to text
« Reply #1 on: June 30, 2005, 05:07:22 PM »
Ive seen the lisp to and cant find it Ive searched under prefix and layer.Bet it has some stupid non revelant post title.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Add prefix to text
« Reply #2 on: June 30, 2005, 06:54:00 PM »
http://new.cadalyst.com/code/browseyear.cfm?fullyear=2005#1

March 2005

Automatic Numbering by Scott Restmeyer, p.0
AUTONUMB.LSP is a very useful tool for maintaining drawings that contain labels.
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.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Add prefix to text
« Reply #3 on: June 30, 2005, 07:20:55 PM »
Do you mean something like this Danny?
Code: [Select]

(defun c:prefix (/ pre ss idx ent obj)
  (vl-load-com)
  (and (setq pre (getstring t "\nEnter prefix: "))
       (setq ss (ssget '((0 . "TEXT,MTEXT"))))
       (setq idx -1)
       (while (setq ent (ssname ss (setq idx (1+ idx))))
(setq obj (vlax-ename->vla-object ent))
(vla-put-textstring obj (strcat pre (vla-get-textstring obj)))
)
       )
  (princ)
  )

danny

  • Guest
Add prefix to text
« Reply #4 on: July 01, 2005, 12:15:06 AM »
CAB,
thanks for the link..got some great tools their.
Jeff,
thats lisp runs great, as always.
Mahalo, :)