请教各位大神, 哪个API要以获取element中的attributes?
我想获取: Embedded BREP 中的scale值
v8i &CE 版本
mdl_ 或其它方法
SmartSolid类型的元素其实是以Cell的形式保存的。所以可以调用mdlCell_extract函数提取相关的信息。MSCE C++示例代码如下:
MSElement cellHeader; mdlAssoc_getElement(&cellHeader, NULL, 641934845L, ACTIVEMODEL); DPoint3d scale; mdlCell_extract(NULL, NULL, NULL, &scale, NULL, 0, &cellHeader); WPrintfString wStr(L"Scale=(%.2f, %.2f, %.2f)", scale.x, scale.y, scale.z); mdlDialog_dmsgsPrint(wStr);
符工, 这个API 只能拿到“Details”中的scale, 而我想拿的是“Attributes” 中的Embedded BREP 中的scale值, 请问怎么获取?
你要获取这个scale的目的何在?另外,请提供一下你这个DGN文件,最好仅保留一个这样的实体。
因为我一个DGN 文件中,多个model, 但是主model 有引用别的model A, 主model无其它element, 仅仅引用别的model A, 所有element 在model A中。
问题是: 打开主model时,在读取引用model A 中的element 有API 获取到的数据transform不对; 如果打开model A 为active model 再读取element 就没有这个问题。
其中model A 中, 就有些element 中attribute栏里有上面提到的 scale值, 有些elements 中的attributes栏没有这样的属性值
我在我提问的另外一个问题 “多模型引用Transform 和 scale的问题” 提到。
https://communities.bentley.com/communities/other_communities/chinafirst/f/microstation-projectwise/186263/transform-scale
Answer Verified By: Allen Chen
你调用mdlElmdscr_readToMaster试一下,该函数能自动实现参考模型到主模型的变换。