NX CAM二次开发-创建程序组
voi MyClass::do_it(
-
void MyClass::do_it() { tag_t setup_tag=NULL_TAG; UF_SETUP_ask_setup(&setup_tag); if (setup_tag == NULL_TAG) { uc1601("错误:请先初始化加工环境.", 1); return; } int count=0; tag_t *objects; UF_UI_ONT_ask_selected_nodes(&count, &objects); for (int i=0; i<count; i++) { 创建程序组 tag_t new_object=NULL_TAG; UF_NCPROG_create("mill_planar", "PROGRAM", &new_object); UF_NCGROUP_accept_member(objects[i], new_object); //移动程序组 UF_OBJ_set_name(new_object, "Hu999"); //对象改名 //UF_OBJ_delete_object(objects[i]); //删除对象 } UF_UI_ONT_refresh(); }
tag_t setup_tag=NULL_TAG;
UF_SETUP_ask_setup(&setup_tag);
if (setup_tag == NULL_TAG)
{
uc1601("错误:请先初始化加工环境.", 1);
return;
}int count=0;
tag_t *objects;
UF_UI_ONT_ask_selected_nodes(&count, &objects);
for (int i=0; i<count; i++)
{
创建程序组
tag_t new_object=NULL_TAG;
UF_NCPROG_create("mill_planar", "PROGRAM", &new_object);UF_NCGROUP_accept_member(objects[i], new_object); //移动程序组
UF_OBJ_set_name(new_object, "Hu999"); //对象改名
//UF_OBJ_delete_object(objects[i]); //删除对象
}UF_UI_ONT_refresh();
}