CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 5934
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
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.

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: 1425
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: 616
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,340 seconds.