//获取零件明细表Tag
tag_p_t parts_list;
int num;
UF_PLIST_ask_tags(&parts_list, &num);
if (num > 0)
{
//遍历得到当前工作部件所有的实体
tag_t objectTAg = NULL_TAG;
int thetype, thesubtype;
UF_OBJ_cycle_objs_in_part(UF_ASSEM_ask_work_part(), UF_solid_type, &objectTAg);
while (objectTAg != NULL_TAG)
{
UF_OBJ_ask_type_and_subtype(objectTAg, &thetype, &thesubtype);
if (thesubtype == UF_solid_body_subtype)
{
//将对象添加到零件清单
UF_PLIST_add_object(parts_list[0], false, objectTAg);
}
UF_OBJ_cycle_objs_in_part(UF_ASSEM_ask_work_part(), UF_solid_type, &objectTAg);
}
//更新零件清单
UF_PLIST_update(parts_list[0]);
}
UF_free(parts_list); //释放内存