试图导出Grouped Hole元素内部/外部Curve的节点,将Grouped Hole ElementHandle转换成CurveVector之后,不知道内部/外部Curve在CurveVector中保存的次序是什么,通过代码测试发现CurveVector的第一个元素是内部的Curve,不确定是不是偶然,麻烦老师解答一下,谢谢。
我写了如下测试代码来分析GroupHole的结构,关键函数是ICurvePrimitive::GetChildCurveVectorCP()。
void groupHoleCurveVectorTest() { ElementHandle eh(1475L, ACTIVEMODEL); CurveVectorPtr cv = ICurvePathQuery::ElementToCurveVector(eh); WPrintfString wStr(L"BoundaryType(1:Open, 2:Outer, 3:Inner, 4:ParityRegion) = %d, size=%d", cv->GetBoundaryType(), cv->size()); mdlDialog_dmsgsPrint(wStr); int i = 0; for (ICurvePrimitivePtr cp : *cv) { CurveVectorCP cv2 = cp->GetChildCurveVectorCP(); WPrintfString wStr2(L"[%d] BoundaryType=%d, PrimitveType(2:LineStrng, 3:Arc, 8:CurveVector) = %d, size = %d", i++, cv2->GetBoundaryType(), cp->GetCurvePrimitiveType(), cv2->size()); mdlDialog_dmsgsPrint(wStr2); int i2 = 0; for (ICurvePrimitivePtr cp2 : *cv2) { WPrintfString wStr3(L"\t\t[%d] PrimitveType=%d", i2++, cp2->GetCurvePrimitiveType()); mdlDialog_dmsgsPrint(wStr3); } } }
GroupHole元素的几何表达是一个CurveVector,该CurveVector下由多个类型为CURVE_PRIMITIVE_TYPE_CurveVector的CurvePrimitive组成。由每个CurvePrimitive又能获得一个ChildCurveVector,你可以从这个ChildCurveVector中得到具体的几何。
针对具体的一个GroupHole,输出如下:
Answer Verified By: Zemin.Li
非常感谢!