Author Topic: how to add pi symbol in autocad text  (Read 26516 times)

0 Members and 1 Guest are viewing this topic.

Sam

  • Bull Frog
  • Posts: 201
how to add pi symbol in autocad text
« on: July 20, 2012, 07:54:38 AM »
Dear Sir,

how to add pi symbol in autocad text
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: how to add pi symbol in autocad text
« Reply #1 on: July 20, 2012, 08:02:21 AM »
One way would be to add the unicode value like so:
Code: [Select]
\U+03C0In lisp you'd need to double backslash the U+.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: how to add pi symbol in autocad text
« Reply #2 on: July 20, 2012, 08:03:49 AM »
Use Unicode, e.g.:

Code: [Select]
(defun c:test ( )
    (entmake '((0 . "TEXT") (40 . 1.0) (10 0.0 0.0 0.0) (1 . "\\U+03C0")))
    (princ)
)

Edit: Irne beat me to it :P


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: how to add pi symbol in autocad text
« Reply #3 on: July 20, 2012, 10:14:35 AM »
And %%960  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: how to add pi symbol in autocad text
« Reply #4 on: July 20, 2012, 10:44:23 AM »
And %%960  8)
Is that for special SHX fonts? I get text displaying %%960 even if I use \960 it doesn't convert. Tried using ARIAL.TTF & Romans.SHX. The Unicode works on ARIAL.TTF, but only works on Romans.SHX if you turn on the "Use Big Font" check in the Style dialog.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: how to add pi symbol in autocad text
« Reply #5 on: July 20, 2012, 10:46:52 AM »
Simplex.shx
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Sam

  • Bull Frog
  • Posts: 201
Re: how to add pi symbol in autocad text
« Reply #6 on: July 21, 2012, 01:27:48 AM »
Dear all sir,

Thx for reply
1) irneb sir thx nice
2) lee mac sir i use u r lisp but not create a text
3) cab sir thx its also good

Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: how to add pi symbol in autocad text
« Reply #7 on: July 21, 2012, 08:33:02 AM »
And %%960  8)
Is that for special SHX fonts? I get text displaying %%960 even if I use \960 it doesn't convert. Tried using ARIAL.TTF & Romans.SHX. The Unicode works on ARIAL.TTF, but only works on Romans.SHX if you turn on the "Use Big Font" check in the Style dialog.
I never explored Big Fonts but maybe they are above the normal range of character codes.
It's aggravating at times when trying to use special characters as they vary from font to font.
 
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: how to add pi symbol in autocad text
« Reply #8 on: July 21, 2012, 08:57:43 AM »
The thing is, if my font is Romans.SHX and I want one of these unicode characters, then 9/10 times the charcter is displayed as some TTF font (usually Arial). If I set the Romans to use Big Font, then most of these characters display correctly. So it seems that BF simply implements the UniCode in the font as well, meaning instead of only 230 od characters there could be 1000's

I've not tried the Standard.SHX much. We generally don't use it. So I can't say much about its Big Font, though I think it uses the same one as for Romans.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: how to add pi symbol in autocad text
« Reply #9 on: July 21, 2012, 09:27:45 AM »
Maybe a font expert will help us out.  8-)
I don't have a Standard.shx and the STANDARD style gets me into trouble as it can vary from user to user & file to file.

Looks like the Big Font is a separate file.
http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS73099cc142f4875513fb5cd10c4aa30d6b-7ed8.htm,topicNumber=d0e406072
« Last Edit: July 21, 2012, 09:37:25 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: how to add pi symbol in autocad text
« Reply #10 on: July 21, 2012, 02:41:46 PM »
2) lee mac sir i use u r lisp but not create a text

It should create a Text object with text height 1.0 and insertion point at the origin.

At least, it does for me :)

DEVITG

  • Bull Frog
  • Posts: 479
Re: how to add pi symbol in autocad text
« Reply #11 on: July 21, 2012, 11:19:50 PM »
Lee Mac , I got a ? as text.

Location @ Córdoba Argentina Using ACAD 2019  at Window 10

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: how to add pi symbol in autocad text
« Reply #12 on: July 22, 2012, 01:10:01 AM »
Lee Mac , I got a ? as text.
That's due to the font you're using. It has to define the character with that unicode (hex:3C0, dec:960, oct:1700). Most of the SHX fonts only define the normal ANSI codes, i.e. dec:32/hex:20 (space) through dec:255/hex:FF (ÿ). For the characters in excess of that you either need to add the bigfont option to the style, or use a TTF font in the style instead.

Note, not all TTF fonts define all unicode characters either. The easiest way to find them IMO is to check the Character Map program in windows - that's also where I find the unicode value to input into acad.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Sam

  • Bull Frog
  • Posts: 201
Re: how to add pi symbol in autocad text
« Reply #13 on: July 23, 2012, 03:27:55 AM »
2) lee mac sir i use u r lisp but not create a text

It should create a Text object with text height 1.0 and insertion point at the origin.

At least, it does for me :)
Dear Sir
thxx got it
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

RONR

  • Mosquito
  • Posts: 10
Re: how to add pi symbol in autocad text
« Reply #14 on: July 25, 2012, 06:42:23 PM »
Change to Greeks font and use lowercase P.  Greeks is native to AutoCAD.  You can also use this method to get the Ohms symbol by using uppercase W.