To map a text table in a DWG file, I created dictionaries.
I loaded the text data and made a dictionary for each column.
I would like to make a new dictionary which merges each column.
When making a dictionary of each column, the dictionary is sorted by order. I just want to assemble each column for making a new table dictionary.
If you have a more easy way to map text, please comment.
This picture shows the problem:
// make a dictionary of text in the table
if ((vText.Point1.X <= xBoundaryEnd) && (vText.Point.X >= xBoundaryStart) && (vText.Point1.Y <= yBoundaryEnd) && (vText.Point.Y >= yBoundaryStart)){
bomTextDictionary.Add(vText.Handle,
new textDataType
{
text = vText.UnicodeText,
refPointX = vText.Point1.X,
refPointY = vText.Point1.Y
});
}
// first column of table (number) dictionay by distingushing vertical line from the bomTextDictionary.
var numberDict = bomTextDictionary.Where(x => x.Value.refPointX >= verticalLineDictionary.ElementAt(0).Value.xStart && x.Value.refPointX <= verticalLineDictionary.ElementAt(1).Value.xStart)
.ToDictionary(text => text.Key, text => text.Value.text);