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 (285 Views)

Underline mtext

285 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 (285 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 (285 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.