chelsea1307 Posted October 27, 2009 Posted October 27, 2009 is there a easy way to add an underline to all selected dtext? Quote
Cadologist Posted October 27, 2009 Posted October 27, 2009 I don't believe there is anything directly in AutoCAD that will do this, but I'm sure someone could create a LISP or possibly one is already existing that will do this for you. You can do this IF the text is all the same (like the same words) easily by adding the %%U prior to the text in the properties pane but that is only if all the text is the same (highly unlikely). Quote
lpseifert Posted October 27, 2009 Posted October 27, 2009 You could use this lisp (thanks to the unknown author) and use %%u as the prefix AddPrefix.lsp Quote
ronjonp Posted October 27, 2009 Posted October 27, 2009 Give this a whirl: (defun c:txt (/ ss str u) (vl-load-com) (initget 1 "U L REV UN RE") (if (and (setq u (getkword "\nUpper Lower UNderline REmove-Underline REVerse: ")) (setq ss (ssget ":L" '((0 . "TEXT")))) ) (foreach x (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) ) (setq str (vla-get-textstring x)) (cond ((= u "U") (vla-put-textstring x (strcase str))) ((= u "L") (vla-put-textstring x (strcase str t))) ((and (= u "UN") (not (wcmatch (strcase str) "*%%U*"))) (vla-put-textstring x (strcat "%%U" (vla-get-textstring x))) ) ((= u "RE") (if (wcmatch (strcase str) "*%%U*") (vla-put-textstring x (vl-string-subst "" "%%U" (vla-get-textstring x))) ) ) ((= u "REV") (vla-put-textstring x (apply 'strcat (mapcar 'chr (reverse (vl-string->list str)))) ) ) ) ) ) (princ) ) Quote
Tankman Posted October 27, 2009 Posted October 27, 2009 You could use this lisp (thanks to the unknown author) and use %%u as the prefix Besides the Steelers, more good "stuff" from Pittsburgh, PA! :wink: Quote
Ollie8974 Posted October 28, 2009 Posted October 28, 2009 Why reinvent the wheel? On the text formatting tool bar near the center, there is a U with a line under it. High lite the text you want underscored then click that button. Quote
alanjt Posted October 28, 2009 Posted October 28, 2009 Why reinvent the wheel?On the text formatting tool bar near the center, there is a U with a line under it. High lite the text you want underscored then click that button. That would force the user to open every text object. She was hoping to avoid just that. Quote
chelsea1307 Posted January 21, 2010 Author Posted January 21, 2010 sorry for the late reply got moved onto other things, ronjonp your lisp worked great, lpseifert when i download the attached lisp it is just a bunch of funky symbols. is there a way to make ronjonps lisp work with mtext? i tried exploding all my mtext back to dtext used the lisp then tried t2m (text2mtext lisp) but it just put %%u in front of everything and took out the underline Quote
David Bethel Posted January 21, 2010 Posted January 21, 2010 I think that this should work: [b][color=BLACK]([/color][/b]defun c:ultext [b][color=FUCHSIA]([/color][/b]/ ss i en ed tv pre[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]0 . [color=#2f4f4f]"*TEXT"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq i -1[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss [b][color=BLUE]([/color][/b]setq i [b][color=RED]([/color][/b]1+ i[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] tv [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 1 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] pre nil[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]cond [b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]= [color=#2f4f4f]"TEXT"[/color] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 0 ed[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]setq pre [color=#2f4f4f]"%%U"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]= [color=#2f4f4f]"MTEXT"[/color] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 0 ed[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]setq pre [color=#2f4f4f]"\\L"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]and pre [b][color=GREEN]([/color][/b]/= pre [b][color=BLUE]([/color][/b]substr tv 1 [b][color=RED]([/color][/b]strlen pre[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entmod [b][color=BLUE]([/color][/b]subst [b][color=RED]([/color][/b]cons 1 [b][color=PURPLE]([/color][/b]strcat pre tv[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]assoc 1 ed[b][color=RED])[/color][/b] ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] -David Quote
chelsea1307 Posted January 21, 2010 Author Posted January 21, 2010 that works perfect thank you Quote
David Bethel Posted January 21, 2010 Posted January 21, 2010 You're welcome. Here's a little tweak so that you don't add the prefix twice. [color=#8b4513];;;UNDERLINE TEXT SELECTIONS[/color] [b][color=BLACK]([/color][/b]defun c:ultext [b][color=FUCHSIA]([/color][/b]/ i ss en ed tv pf[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq i -1 ss [b][color=MAROON]([/color][/b]ssget '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]0 . [color=#2f4f4f]"*TEXT"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss [b][color=BLUE]([/color][/b]setq i [b][color=RED]([/color][/b]1+ i[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] tv [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 1 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] pf [b][color=GREEN]([/color][/b]cond [b][color=BLUE]([/color][/b][b][color=RED]([/color][/b]= [color=#2f4f4f]"TEXT"[/color] [b][color=PURPLE]([/color][/b]cdr [b][color=TEAL]([/color][/b]assoc 0 ed[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [color=#2f4f4f]"%%U"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b][b][color=RED]([/color][/b]= [color=#2f4f4f]"MTEXT"[/color] [b][color=PURPLE]([/color][/b]cdr [b][color=TEAL]([/color][/b]assoc 0 ed[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [color=#2f4f4f]"\\L"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]T nil[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]and pf [b][color=GREEN]([/color][/b]/= pf [b][color=BLUE]([/color][/b]strcase [b][color=RED]([/color][/b]substr tv 1 [b][color=PURPLE]([/color][/b]strlen pf[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entmod [b][color=BLUE]([/color][/b]subst [b][color=RED]([/color][/b]cons 1 [b][color=PURPLE]([/color][/b]strcat pf tv[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]assoc 1 ed[b][color=RED])[/color][/b] ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] -David Quote
hosyn Posted June 16, 2023 Posted June 16, 2023 On 1/21/2010 at 10:51 PM, David Bethel said: You're welcome. Here's a little tweak so that you don't add the prefix twice. [color=#8b4513];;;UNDERLINE TEXT SELECTIONS[/color] [b][color=BLACK]([/color][/b]defun c:ultext [b][color=FUCHSIA]([/color][/b]/ i ss en ed tv pf[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq i -1 ss [b][color=MAROON]([/color][/b]ssget '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]0 . [color=#2f4f4f]"*TEXT"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss [b][color=BLUE]([/color][/b]setq i [b][color=RED]([/color][/b]1+ i[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] tv [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 1 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] pf [b][color=GREEN]([/color][/b]cond [b][color=BLUE]([/color][/b][b][color=RED]([/color][/b]= [color=#2f4f4f]"TEXT"[/color] [b][color=PURPLE]([/color][/b]cdr [b][color=TEAL]([/color][/b]assoc 0 ed[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [color=#2f4f4f]"%%U"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b][b][color=RED]([/color][/b]= [color=#2f4f4f]"MTEXT"[/color] [b][color=PURPLE]([/color][/b]cdr [b][color=TEAL]([/color][/b]assoc 0 ed[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [color=#2f4f4f]"\\L"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]T nil[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]and pf [b][color=GREEN]([/color][/b]/= pf [b][color=BLUE]([/color][/b]strcase [b][color=RED]([/color][/b]substr tv 1 [b][color=PURPLE]([/color][/b]strlen pf[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entmod [b][color=BLUE]([/color][/b]subst [b][color=RED]([/color][/b]cons 1 [b][color=PURPLE]([/color][/b]strcat pf tv[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]assoc 1 ed[b][color=RED])[/color][/b] ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] -David Hi guys Anyone could tell me that , whats these things in these codes:: [b][color=GREEN]([/color][/b]/= pre [b][color=BLUE]([/color] and what exactly wheres use of them and whats that application of them.?? Quote
BIGAL Posted June 17, 2023 Posted June 17, 2023 They are the control codes for the forum in an older style, if you download lisp code then remove them entirely then lisp will work. PS Hopefully. 1 Quote
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.