AutoCAD Character Codes In Text String
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm experiencing some inconsistent behavior with text (normal text, mtext, text in a table) and character codes. I'll provide some examples of what I'm seeing... and hopefully someone can help me to understand what's going on.
We use a customized shx font that has stacked fractions in sixteenth increments from character 181 to 195 (1/16 to 15/16). So, when entering 1/16, a user would typically type %%181 as the text value, and AutoCAD displays the correct stacked fraction. This works in normal text, but not in mtext or in a table. With mtext or a table, I can copy and paste character 181 (for instance) - which looks like [ µ ] - and the correct stacked fraction will show up. Surely there is a way to do this without copy and paste, but I haven't gotten that far.
Ok, so - you're probably wondering why I am writing this in the .NET forum. Well, here is where some code comes in.
With normal text, I can set DBText.TextString = "%%181". This will display the correct stacked fraction (1/16). If I then retrieve the text again - string myText = DBText.TextString), the value is as expected - "%%181".
BUT
If a user types "%%181" in a piece of text, and then I read the piece of text, the value is character 181. This was not the case in AutoCAD 2006, where TextString would still reflect "%%181" - behavior that (to me) made sense, because it was consistent.
All of this becomes a problem when programmatically parsing text. Sometimes it has %%[character code], and sometimes it has the character.
Can someone please shed some light on this?