【NX二次开发】获取边、曲线的端点,封装
封装函数:
//获得曲线或边的两个端点坐标 void getCurveVerts(tag_t curveEdge, double startPos[3], double endPos[3]) { int type=0, subtype=0; UF_OBJ_ask_type_and_subtype(curveEdge, &type, &subtype); if (type == UF_solid_type && subtype==UF_solid_edge_subtype) { int vertex_count=0; UF_MODL_ask_edge_verts(curveEdge, startPos, endPos, &vertex_count); } else { double junk[3]={ 0.0, 0.0, 0.0 }; UF_MODL_ask_curve_props(curveEdge, 0.0, startPos, junk, junk, junk, junk, junk); UF_MODL_ask_curve_props(curveEdge, 1.0, endPos, junk, junk, junk, junk, junk); } }