【NX二次开发】判断两个体是否干涉
效果:
源码:
vector<NXOpen::TaggedObject *> vecObj = this->selection0->GetSelectedObjects(); if (vecObj.size() == 2) { tag_t tagTarget = vecObj[0]->Tag(); tag_t tagTools[1]; tagTools[0] = vecObj[1]->Tag(); int iRes = 0; UF_MODL_check_interference(tagTarget, 1, tagTools, &iRes); if (iRes == 1) { HtkBase2::list("干涉\n", iRes); } else if (iRes == 2) { HtkBase2::list("不干涉\n", iRes); } else if (iRes == 3) { HtkBase2::list("接触\n", iRes); } else { HtkBase2::list("未知\n", iRes); } }