NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_ui_ont.h> #include <uf_camgeom.h> #include <uf_cambnd.h> UF_initialize(); //获取当前加工导航器选中的对象数量和TAG int count = 0; tag_t* objects = NULL_TAG; UF_UI_ONT_ask_selected_nodes(&count, &objects); for (int i = 0; i < count; i++) { tag_t operTag = objects[0]; //附加从边界或曲线创建的边界对象 int lineCount=vLineTags.size(); tag_t curves[1000]; for (int i=0; i<lineCount; i++) { if (i<1000) curves[i]=vLineTags[i]; } UF_CAMBND_boundary_data_t boundary_data; boundary_data.boundary_type=UF_CAM_boundary_type_closed; boundary_data.plane_type=1; boundary_data.origin[0]=0; boundary_data.origin[1]=0; boundary_data.origin[2]=0; boundary_data.matrix[0]=1; boundary_data.matrix[1]=0; boundary_data.matrix[2]=0; boundary_data.matrix[3]=0; boundary_data.matrix[4]=1; boundary_data.matrix[5]=0; boundary_data.matrix[6]=0; boundary_data.matrix[7]=0; boundary_data.matrix[8]=1; boundary_data.material_side=UF_CAM_material_side_in_left; boundary_data.ignore_holes=0; boundary_data.ignore_islands=0; boundary_data.ignore_chamfers=0; boundary_data.app_data=NULL; UF_CAMBND_append_bnd_from_curve(operTag, UF_CAM_trim, lineCount, curves, &boundary_data,NULL); } //释放 UF_free(objects); UF_terminate(); Caesar卢尚宇 2020年5月23日