Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Kent1Cooper
en respuesta a: leandro_miya


@leandro_miya wrote:

.... Is it possible to change the code for simple Text? If so, what changes should I make? ....


Try this modification -- the red parts are all that I changed [untested]:

(defun C:UT (/ ss n edata); = Underline Text(s)
  (if (setq ss (ssget "_:L" '((0 . "TEXT"))))
    (repeat (setq n (sslength ss)); then
      (setq edata (entget (ssname ss (setq n (1- n)))))
      (entmod
        (subst
          (cons 1 (strcat "%%U" (cdr (assoc 1 edata))))
          (assoc 1 edata)
          edata
        ); subst
      ); entmod
    ); repeat
  ); if
  (princ)
); defun

If any selected Text object has its entire contents already underlined by the same %%U entry at the beginning, the above will un-underline it.  It could be made to check for that, if desired, and not add another %%U.

Kent Cooper, AIA