UG\NX CAM secondary development to judge whether the object is a group

Article author: Foundry
Source website: NX CAM secondary development column


Introduction:

        UG\NX CAM secondary development to judge whether the object is a group

code:

void GetAllOperTag(tag_t groupTag, vector<tag_t> &vOperTags) 
{ 
 int count=0;
 tag_t * list;
 UF_NCGROUP_ask_member_list(groupTag, &count, &list);
 
 for (int i=0; i<count; i++)
 {
  logical answer=false;
  UF_NCGROUP_is_group(list[i], &answer);//判断对象是不是组
  if (answer)
  {
   GetAllOperTag(list[i], vOperTags);
  }
  else
  {
   int type=0, subtype=0;
   UF_OBJ_ask_type_and_subtype(list[i], &type, &subtype);
   if (type == UF_machining_operation_type)
   {
    vOperTags.push_back(list[i]);
   }
  }
 }
}
 
//递归的方式函数中调用自己 
void MyClass::do_it()
{
 //获取加工设置的TAG
 tag_t setup_tag=NULL_TAG;
 UF_SETUP_ask_setup(&setup_

Guess you like

Origin blog.csdn.net/WangPaiFeiXingYuan/article/details/132657597