NX二次开发 PK获得对象类型 PK_ENTITY_ask_class
//获得对象类型
bool PKPK_AskObjectType(const PK_ENTITY_t pkObject, PK_CLASS_t& pkType)
{
pkType = 0;
if (0 == pkObject)
return false;
if (PK_ENTITY_ask_class(pkObject, &pkType))
return false;
return true;
}
//获得面类型
bool PKPK_AskFaceType(const PK_FACE_t pkFace, PK_CLASS_t& pkType)
{
pkType = 0;
if (0 == pkFace)
return false;
PK_SURF_t pkSurf = 0;
if (PK_FACE_ask_surf(pkFace, &pkSurf))
return false;
if (PK_ENTITY_ask_class(pkSurf, &pkType))
return false;
return true;
}
//获得边类型
bool PKPK_AskEdgeType(const PK_EDGE_t pkEdge, PK_CLASS_t& pkType)
{
pkType = 0;
if (0 == pkEdge)
return false;
PK_CURVE_t pkCurve = 0;
if (PK_EDGE_ask_curve(pkEdge, &pkCurve))
return false;
if (PK_ENTITY_ask_class(pkCurve, &pkType))
return false;
return true;
}
//分析B曲面来源类型(只能输入:B曲面,作用是如果B曲面非常接近圆柱、圆锥、球、平面、环面、横扫面那么就接近的类型)
bool PKPK_AskFaceFormType(const PK_F