Attribute Special Codes
Posted: 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
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