Hi,
When i measure the side of the square with mdlElmdscr_computeRange(), side of the square was calculated 0.001 mm incorrectly. why the results were calculated 0.001 mm incorrectly?
Ex: for 30x30 mm square i'm getting the following values.
Unknown said:mdlElmdscr_computeRange()
That function is used to compute the range block of an element. Search for range block in MDL help for some hints.
The range of an element is a rectangle (2D) or cuboid (3D) that encloses an element. That is, each and every vertex of the element falls within the range block. If the element is transformed (i.e. rotated, scaled or skewed) then MicroStation recalculates its range block.
This article discusses the boundary of a text element.
A common use of range blocks is when scanning a model. You can restrict a scan spatially by telling MicroStation to look for elements that fall within a specified range (mdlScanCriteria_setRangeTest).
The range of an element is not a precise measurement. It is an approximation. If you want to measure precisely the vertices of your shape element, then use mdlLinear_extract.
Regards, Jon Summers LA Solutions
Answer Verified By: Neslihan AYDIN
Actually I have a cabinet ( like in the image ) and I want to get its size. How can I measure a cabinet's size in MDL with exact dimensions?
Best Regards,
Neslihan Aydin
AEC Technology Inc.
Unknown said: I have a cabinet ( like in the image )
It's great that you've posted a screenshot, but we can't analyse a screenshot. Why not post a small DGN example? We all use MicroStation, and so we can analyse a DGN example.
To put it another way, I can't tell if your cabinet is (a) a SmartSolid or (b) several shapes grouped in a cell.
Unknown said:Why not post a small DGN example?
You are right. I've added dgn file.
I want to get the same value like in the element information.
Unknown said: I've added dgn file.
Now we know what you have: a top-level cell named A0000700. That cell contains a number of nested cells and elements, including some SmartSolids.
Unknown said:I want to get the same value like in the element information
I'm not sure what data in the Element Information dialog you find useful.
When you have a cell, you want to iterate its component elements. In this case, you have nested cells. You want to iterate each nested cell and its components.
One way to perform that task is to call mdlModify_elementSingle. You don't have to modify anything. Your callback function can perform the analysis you want …
typedef struct your_data_struct_ { int v1; // Put whatever data you want in here } YourDataStruct, *YourDataStructP;
int yourCallbackFunc ( MSElementUnion *element, // <=> element to be modified void *params, // => user parameter DgnModelRefP modelRef, // => model to hold current elem MSElementDescr *elmDscrP, // => element descr for elem MSElementDescr **newDscrPP, // <= if replacing entire descr ModifyElementSource elemSource // => The source for the element ) { YourDataStructP data = (YourDataStructP)params; AnalyseElement (elmDscrP, data); return MODIFY_STATUS_NOCHANGE; }
YourDataStruct data; mdlModify_elementSingle (modelRef, filePos, MODIFY_REQUEST_HEADERS, MODIFY_ORIG, yourCallbackFunc, &data, 0);
void AnalyseElement (MSElementDescr const* pElm, YourDataStructP data) { // Analyse element }
A SmartSolid is an opaque cell. You can't see inside it other than by using the mdlKISolid_api.
Use mdlKISolid_isAnalyticBody to determine if a body is simple and can be analysed.