Hi Team,
I'm working on i.dgn file and trying to read the elements from a specific cellheader using the MDL API "mdlKISolid_bodyToElements" and receiving wrong data from it.
I've attached a sample file for reference, and the graphic details are provided below./cfs-file/__key/communityserver-discussions-components-files/343173/SampleFile.dgn.i.dgn
MicroStation version details that is being used.MIcroStation V8i SS3 - version is 08.11.09.357.
Graphic Info:Cell header Name: TEE, BW 18 CL600_DUMMY 0303-P0164Element ID: 66115
API Code
int iStatusLocal = mdlKISolid_bodyToElements(pElemDescr, kBody, FALSE, -1, &m_pElemDescr->el, m_pDgnModelRef);
We have lines and Smart Surfaces in the first cellheader, and I can retrieve the lines data correctly, however for Smart Surfaces, only a single line is returned from the API instead of BSPLINE_SURFACE_ELM.
Could you please take a look and let us know on the issue.Thank you!
Bency Gregorioz said:I've attached a sample file
Excellent!
It's a busy drawing. Where in the model is the TEE you've analysed in your screenshot? I think I've found it, but when I analyse it I don't see the same components as you...
Is your screenshot of the original .dgn file or of the iModel?
.dgn
Regards, Jon Summers LA Solutions
Jon Summers said:I think I've found it, but when I analyse it I don't see the same components as you...
It is because original capture was done in V8i, but yours comes from CONNECT Edition. CE represents elements as "objects", with internal structure hidden.
Bency Gregorioz said:I'm working on i.dgn file
Where the i.dgn file comes from? Was it created in MicroStation or in some other (possibly not Bentley) product?
Bency Gregorioz said:Could you please take a look and let us know on the issue.
It is hard to say without writing test code.
What you can try is to use mdlKISolid_bodyToElementD, when SmartSolid and SmartSurface objects should be returned as cell elements (because they are stored as cells with extra data inside) and maybe it's simple to extract internal data in next step.
Maybe the problem (but I think it should be visible graphically in such case) is that i-model does not contain original elements representation with all data, but only simplified, with minimum data, necessary for geometrical representation, and the function does not work well in this situation.
Bency Gregorioz said:and trying to read the elements from a specific cellheader using the MDL API
A question what data you want to read: SmartSolid and SmartSurface are breps, so only boundaries (lines, b-splines...) are stored. Anything more is an abstraction / conversion on top of boundaries and attached data.
Alternative approach is to do not use low level C access, but to use ElementGraphicsOutput and IElementGraphicsProcessor classes, available in V8 C++ API (MicroStationAPI.chm), which is one from core tools in CONNECT Edition now. It allows to decompose any element to define components (e.g. bodies / facets /...), so you do not care about original data structure (how element is stored).
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thanks for the updateYup, I'm querying for the boundaries informationTo Add a Note: After copying that specific Tee graphic into a new dgn file, I was able to correctly read the graphic data, which is BSPLINE_SURFACE_ELM components from Smart Surface using the API.
Bency Gregorioz said:I was able to correctly read the graphic data, which is BSPLINE_SURFACE_ELM components from Smart Surface using the API.
Thanks for the update.
It sounds like the original element was somehow corrupted and when created from scratch, it was corrected, or, as second option, there is bug in access to .i.dgn data through API.
Hi Jan,
Jan Ĺ legr said:What you can try is to use mdlKISolid_bodyToElementD
I tried using the mdlKISolid_bodyToElementD as you suggested, but no luck and the specific smart surface data is still missing.
Jan Ĺ legr said:the original element was somehow corrupted
Is there any way to recover a corrupted element from an i.dgn file using Microstation V8i?How can I identify a corrupted graphic in an i.dgn file? Is there an API that provides information about the corrupted graphics
Query Regarding the API mdlKISolid_bodyToElements
Despite the API generating incorrect data, it still returns a success value. I would appreciate any comments or observations regarding this particular behavior.
As you mentioned, there could be a bug in the API to access the i.dgn data.Could you please confirm on this point? If so, what further action may be taken on this issue?
We can successfully retrieve smart-surface data by using _ProcessParasolidBody, however the logic we are using is the same as _ProcessParasolidBody.
Thanks for the information and I'll investigate further on this
Thank you!
Bency Gregorioz said:Could you please confirm on this point?
How can I confirm such thing? I am not Bentley developer.
Bency Gregorioz said:If so, what further action may be taken on this issue?
Send request to Bentley support.
Regards,
Bency Gregorioz said: There could be a bug in the API to access the i.dgn data. What further action may be taken on this issue?
You're developing for MicroStation V8i, which is no longer supported by Bentley Systems. Don't expect them to fix a bug in an obsolete API.