AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Is it possible to change the color of the line in "underlined text" created
with the %%u without changing the color of the text ?

I don't know how to change the %%u, but this will do the same job.
Just change the layer/color to suit :

;;;CODING STARTS HERE
(defun C:ULINE ( / textent tb ll ur ul lrx1 y1 x2 y2 p1 p2)
(setvar "CMDECHO" 0)
(setq textent (car (entsel "\nSelect text: ")))
(command "UCS" "ENTITY" textent)
(setq tb (textbox (list (cons -1 textent)))
ll (car tb)
ur (cadr tb)
ul (list (car ll) (cadr ur))
lr (list (car ur) (cadr ll))
fact (* (getvar "LTSCALE") 0.3)
x1 (car ll)
y1 (cadr ll)
x2 (car lr)
y2 (cadr lr)
x1 (- x1 fact)
y1 (- y1 fact)
x2 (+ x2 fact)
y2 (- y2 fact)
p1 (list x1 y1)
p2 (list x2 y2)
);setq
;;;I use Ltscale as my scaling factor.
(command "LAYER" "M" "10" ""
"PLINE" p1 "W" (* (getvar "LTSCALE") 0.05) "" p2 ""
"UCS" "P"
);command
(princ)
);defun
(princ)
;;;CODING ENDS HERE

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website