Attribute Special Codes
Moderators: SDS, support, admin
Attribute Special Codes
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
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
Re: Attribute Special Codes
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.
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
Chat support on Skype: cadsofttools.support
Re: Attribute Special Codes
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
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