文章作者:代工
来源网站:NX CAM二次开发专栏
简介:
UG\NX CAM二次开发 判断对象是不是组
代码:
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_