Attribute Special Codes

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
dland4000
Posts: 6
Joined: 10 Apr 2009, 07:35

Attribute Special Codes

Post by dland4000 » 25 Apr 2009, 00:27

Hi,

I'm using CAD Import.NET to read in blocks and attributes from DWG files. Some of the attribute values contain special characters for underlining the text (e.g. %%uSomeValue which appears in AutoCAD as the string "SomeValue" underlined). The problem is that CADImport.NET is placing a non-human readable characters where the special codes are, which is causing problems for what I'm trying to do. Is there any supported way to detect when one of these special codes has been used and strip it out of the attribute value string?

I have a work-around that I came up with based on the fact that it appears that the special codes show up in the string as bytes with the value 1. I could do something like this:

char[] attrName = attr.Tag.ToCharArray().Where(x => x != 1).ToArray();
char[] attrValue = attr.Text.ToCharArray().Where(x => x != 1).ToArray();

However, I'm a little concerned about how robust this solution is since it relies on the special codes having the value 1. Is there another way to get this accomplished that is more supported in CADImport.NET?

Thanks,
Dave

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Attribute Special Codes

Post by support » 27 Apr 2009, 09:42

Hello Dave,

In the same text line even group "%%u" is being replased by "char(1)", odd group "%%u" is being replased by "char(2)"
In the same text line even group "%%o" is being replased by "char(3)", odd group "%%o" is being replased by "char(4)"

This is a heritage of the previouse version of the library. It will be changed in future.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

dland4000
Posts: 6
Joined: 10 Apr 2009, 07:35

Re: Attribute Special Codes

Post by dland4000 » 27 Apr 2009, 18:26

Sergey,

Thank you very much. That was extremely helpful because I didn't notice the difference between the odd and even underlines and I didn't even know about the %%o special character for overlines. Very helpful.

Dave

Post Reply