NX二次开发 PK获得两个面公共边 PK_FACE_find_edges_common
bool AskSharedEdges(const tag_t face_tag1, const tag_t face_tag2, std::vector<tag_t>& edges)
{
int i = 0, n_edges = 0;
tag_t ps_tag1 = NULL_TAG, ps_tag2 = NULL_TAG, edge_tag = NULL_TAG;
PK_EDGE_t* pkEdges = NULL;
edges.clear();
if (NULL_TAG == face_tag1
|| NULL_TAG == face_tag2
|| UF_PS_ask_ps_tag_of_object(face_tag1, &ps_tag1)
|| UF_PS_ask_ps_tag_of_object(face_tag2, &ps_tag2)
|| PK_FACE_find_edges_common(ps_tag1, ps_tag2, &n_edges, &pkEdges)
|| 0 == n_edges)
{
return false;
}
for (i = 0; i < n_edges; i++)
{
if (!UF_PS_ask_object_of_ps_tag(pkEdges[i], &edge_tag))
{
edges.push_back(edge_tag);
}