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

0 Members and 2 Guests 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: 12914
  • 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: 12914
  • 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: 480
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.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: how to add pi symbol in autocad text
« Reply #15 on: July 26, 2012, 06:19:03 AM »
Good idea! So inside MTexts / Dim Overrides / MLeader texts you can place the following piece of text from Lisp:
Code - Auto/Visual Lisp: [Select]
  1. "{\\Fgreeks|;p}" ;Using the Greeks.SHX font
  2. "\\U+03C0" ;Using the unicode double-byte character code
For other stuff you can do the same, e.g. micro Ohms:
Code - Auto/Visual Lisp: [Select]
  1. "{\\Fgreeks|;mW}" ;Greek font
  2. "\\U+03BC\\U+03A9" ;Unicode
Or indicating delta:
Code - Auto/Visual Lisp: [Select]
  1. "{\\Fgreeks|;D}" ;Greek font
  2. "\\U+0394" ;Unicode

The nice thing about using Greeks.SHX is the characters look as if they are the same font as the Romans.SHX font. Where the unicode uses alternative fonts if the BigFont is not turned on. And even with BigFont turned on, I like the Greeks version more.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: how to add pi symbol in autocad text
« Reply #16 on: July 26, 2012, 07:50:29 AM »
Great idea RONR  :-)

Greekc.shx is also rather nice:


Crank

  • Water Moccasin
  • Posts: 1503
Re: how to add pi symbol in autocad text
« Reply #17 on: July 26, 2012, 01:01:18 PM »
And %%960  8-)
Though it's still working, I believe to remember that Autodesk switched to unicode with Autocad2008. That's when I stopped using %%###.  BTW hex960 = dec03C0 (hint) ;)

The thing is, if my font is Romans.SHX and I want one of these unicode characters, then 9/10 times the character is displayed as some TTF font (usually Arial). [...]
I've never seen a different alternate font than Arial. But I just change these characters to Simplex and then you don't even notice that another font is used for these few characters.
Another thing you can try is to edit your ACAD.FMP file. If you add
Code: [Select]
Arial;ROMANEUR.shx to this file the font ARIAL should (in theory :kewl: ) be replaced with a ROMAN-font that supports the most important unicodes.
Vault Professional 2023     +     AEC Collection

Crank

  • Water Moccasin
  • Posts: 1503
Re: how to add pi symbol in autocad text
« Reply #18 on: July 26, 2012, 01:28:21 PM »
If you open a drawing and you get a message like:
Quote
' ** Undefined shape 8962 '
that means a character is used, but the used font doesn't support that special character.

Owen has made a tool to remove these characters:
Quote
CleanLanguage 1.0                       March 25, 2011

Copyright (C) 2011 ManuSoft (http://www.manusoft.com)
http://www.manusoft.com/software/freebies/arx.html


  ** Legal Stuff **

CleanLanguage is placed in the public domain. The
CleanLanguage binaries may be freely redistributed
or used for any purpose as long as this legal notice
accompanies all files.

ManuSoft disclaims any and all liability for your use
of this software. The software is provided "as is"
without warranty of any kind, either express or implied.


  ** What it does **

CleanLanguage makes an effort to identify and clean
objects in an AutoCAD drawing file that contain corrupt
text characters. Such corruption may cause AutoCAD to
display a warning about a "missing language pack". The
software supports AutoCAD versions 2007 through 2012.


  ** How to use it **

To load the software, drag and drop the appropriate
.arx module into your AutoCAD drawing window, then use
the CLEANLANGUAGE command to clean the drawing.


  ** Support **

ManuSoft does not offer any technical support for this
software, however we do appreciate feedback. Please
contact us with information about any problems you
encounter.


 *****************************************
 ****  ManuSoft                       ****
 ****  POB 101, 34 Maple St.          ****
 ****  Apple Creek, OH, USA 44606     ****
 ****  +1 330-698-1723 (Voice)        ****
 ****  +1 330-698-1770 (Fax)          ****
 ****  http://www.manusoft.com        ****
 ****  support@manusoft.com           ****
 *****************************************
Vault Professional 2023     +     AEC Collection

owenwengerd

  • Bull Frog
  • Posts: 451
Re: how to add pi symbol in autocad text
« Reply #19 on: July 26, 2012, 01:54:51 PM »
CleanLanguage is intended for removing corrupt text; I could be wrong, but I don't think it would remove a missing shape reference from existing text. My SuperPurge utility can remove shape file references, though.