Hello All,
I'm making a MVBA to convert "Table" (composed of text, textnode, line, linestring) from dgn to excel, I need to know the closed range of a point (text/textnode), then I know what text in each cell.
Considering the cell might be merged, the coordinates of vertex are useless. I have tried GetFloodBoundary , it is OK in V8i, might be OK in CE update 11 also, but failed in CE update 10 (Bug?) Refer to https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/174983/ce-mvba-problem-about-getfloodboundary
I'd like to know, if other way to get what I want? Thanks a lot.
Changsong Ling said:I'm making a MVBA to convert "Table"
Take a look at this example.
Regards, Jon Summers LA Solutions
Thanks a lot.
I have another sub to handle such simple text already.
My "table" is much more complicated, it support multiple text/text node, and subscript/superscript. See the sample.
Changsong Ling said:My "table" is much more complicated
Really? Have you look at the code available from the link I posted? It performs some quite sophisticated spatial analysis. Perhaps you would benefit by adapting its techniques?
Yes it is a good reference, I have learned something useful. Thanks a lot.
Regarding to your codes, I had a quick test, there are some comments for your information.
1. I saw the row tolerance is calculated by the textheight, my codes let the user to input the tolerance or use the default value. Of course my codes need to interact with the user.
2. There some cases that the text string is empty which is invisible but could be selected still, such text might need to be ignored. My codes has an option to let the user decide ignore them or not. Your codes select the text by hence, the empty text cannot been select.
3. For text node, only the string of first sub text will be extracted. If you just need to handle such simple text node, it is OK.
4. If the texts are not placed in percise location, some text overlapped with two rows, the result might be wrong.
5. The following sample, maybe the user would like to treat it as three columns.
Unfortunately many drafters here have no good work habit, they don't locate the model percisely, they just place them where it looks like correct location. I have to consider more to eliminate their improper drawing. Maybe your drafters are much better than mine, you don't need to consider these, you are lucy~
Thanks for your great help!
Changsong Ling said:many drafters here have no good work habit, they don't locate the model percisely
A productive way forward would be to create a VBA app. to draw a table. Capture input from a VBA UserForm or COM plugin such as GrapeCity Spread.
That's out of my control... new application need to be approved by the company even it is free, and it need to purchase license, it is almost impossbile here~
I do have a sub to convert from excel to dgn, but its compatibility is not good if we need percise table.