CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
Plex.Earth connects AutoCAD and Google Earth
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closed%%U

 Post Reply Post Reply
Author
marie_b View Drop Down
Newbie
Newbie


Joined: 20.Apr.2010
Location: United States
Status: Offline
Points: 5
Direct Link To This Post Topic: %%U
    Posted: 05.Aug.2020 at 22:07
I have a file that I can only use Single Line text in.  Some things need to be underlined so I use the control U command.  This adds %%U to the contents of the text.  My problem is this file is imported into Corel Draw and the %%U causes issues.  It will only work ok with %%u.  Is there a way to change this command so it adds a little u instead of a capital U?  Or is there any way to find/replace the U with a u?

Thanks!
Back to Top
philippe JOSEPH View Drop Down
Senior Member
Senior Member


Joined: 14.Mar.2011
Location: France
Using: AutoCAD Mechanical 2017
Status: Offline
Points: 1493
Direct Link To This Post Posted: 06.Aug.2020 at 11:36
Helo marie_b, try the command FIND or _FIND. It works with a selection of entities or with all the drawing.
Back to Top
marie_b View Drop Down
Newbie
Newbie


Joined: 20.Apr.2010
Location: United States
Status: Offline
Points: 5
Direct Link To This Post Posted: 06.Aug.2020 at 15:45
Thanks for the reply.

That does not work because it is a code and not actually recognized as text.
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 686
Direct Link To This Post Posted: 12.Aug.2020 at 14:43
Try this:

(defun C:Utou (/ ss n txt str)
  (if (setq ss (ssget "_X" '((1 . "*%%U*"))))
    (repeat (setq n (sslength ss)); then
      (setq
        txt (ssname ss (setq n (1- n)))
        str (getpropertyvalue txt "TextString")
      ); setq
      (while (wcmatch str "*%%U*")
        (setq str (vl-string-subst "%%u" "%%U" str))
      ); while
      (setpropertyvalue txt "TextString" str)
    ); repeat
  ); if
  (princ)
); defun

Minimally tested.  [Curiously under these circumstances, but typically for defined commands, the command name is not case-sensitive.]
Back to Top
marie_b View Drop Down
Newbie
Newbie


Joined: 20.Apr.2010
Location: United States
Status: Offline
Points: 5
Direct Link To This Post Posted: 12.Aug.2020 at 14:48
I don't know much about programming.  What exactly do I do with it?
Back to Top
marie_b View Drop Down
Newbie
Newbie


Joined: 20.Apr.2010
Location: United States
Status: Offline
Points: 5
Direct Link To This Post Posted: 12.Aug.2020 at 15:40
Never mind, I got it figured out.  And it works!

Thank you from the whole support team! Clap
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,201 seconds.