masterfal Posted September 27, 2016 Share Posted September 27, 2016 Hi All, Is there a way to select text and make it bold without having to go into the actual mtext, highlight and change to bold? I've got this handy lisp which can remove underlines from all selected text objects (below). Does anyone know how to modify this so it can add underlines instead of removing? Was thinking maybe this could also be amended so instead of removing/adding underlines it removes/adds bold text. I tried changing %%u to %%b but of course its not that simple (defun c:uline (/ sset num ent sub) (setq sset (ssget '((0 . "*text")))) (setq num 0) (repeat (sslength sset) (setq ent (entget (ssname sset num)) sub (cdr (assoc 1 ent)) ) (if (= (cdr (assoc 0 (entget (ssname sset num)))) "TEXT") (setq ; TEXT sub (vl-string-subst "" "%%U" sub) sub (vl-string-subst "" "%%u" sub) ) (setq ; MTEXT sub (vl-string-subst "" "{\\L" sub) sub (vl-string-subst "" "}" sub) ) ) (setq sub (subst (cons 1 sub)(assoc 1 ent) ent) num (1+ num) ) (entmod sub) ); end repeat (princ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 27, 2016 Share Posted September 27, 2016 Its simpler to play with mtext I would convert the text to mtext if you just add some mtext and change it colour bold underline etc and use something like dumpit.lsp you will see all the hidden coding. BOLD RED underline 1/2 TextString = "\\A1;{\\fArial|b1|i0|c0|p34;BOLD} {\\C1;RED} {\\LUNDERLINE} {\\H0.7x;\\S1/2;}" You could do a simple dialouge with buttons Bold underline etc turn on what is required. Colour would ask for a number or rgb. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 27, 2016 Share Posted September 27, 2016 Please do not add on to old threads. Your question had little to do with the other thread. I created a new thread Bold Text in the AutoLISP, Visual LISP & DCL Forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.