Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
cadman009
Posts: 336
Registered: ‎12-17-2003
Message 1 of 3 (300 Views)

Underline mtext

300 Views, 2 Replies
11-26-2008 08:18 AM
Hey, y'all, Anybody have a routine for underlining multiple instances of mtext? I'm sure it would be a simple routine, but I haven't been into LISP programming for awhile, and I'm having trouble getting my head back into it.
Distinguished Contributor
EC-CAD
Posts: 5,930
Registered: ‎12-12-2003
Message 2 of 3 (300 Views)

Re: Underline mtext

11-26-2008 11:16 AM in reply to: cadman009
Here's an old one I had...



(defun C:UMT ( / ss a b c val new_val ); UnderLine Mtext

(prompt "\nPick MTEXT to Underline: ")

(setq ss (ssget))

(if ss

(progn

(setq c 0)

(repeat (sslength ss)

(setq a (ssname ss c))

(setq b (entget a))

(if (= (cdr (assoc 0 b)) "MTEXT")

(progn

(setq val (cdr (assoc 1 b))); value

(setq new_val (strcat "{\\L" val))

(entmod (subst (cons 1 new_val)(assoc 1 b) b))

(entupd a)

);progn

);if

(setq c (+ c 1))

);repeat

);progn

);if

(princ)

); function



Bob
Distinguished Contributor
cadman009
Posts: 336
Registered: ‎12-17-2003
Message 3 of 3 (300 Views)

Re: Underline mtext

12-01-2008 02:15 PM in reply to: cadman009
Thanks! I'll give it a try.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.