/*=============================================================================
Copyright (c) 2001 Unigraphics Solutions, Inc.
Unpublished - All Rights Reserved
=============================================================================*/
/******************************************************************************
* *
* DESCRIPTION - *
* This program shows how to use the following UG/Open API routine(s): *
* *
* UF_CAMBND_append_bnd_from_curve *
* UF_CAMBND_append_bnd_from_face *
* UF_CAMBND_ask_boundaries *
* UF_CAMBND_ask_boundary_app_data *
* UF_CAMBND_ask_boundary_data *
* UF_CAMBND_ask_boundary_items *
* UF_CAMBND_ask_item_app_data *
* UF_CAMBND_ask_item_entity *
* UF_CAMBND_delete_boundaries *
* UF_CAMBND_delete_boundary *
* UF_CAMBND_set_boundary_app_data *
* UF_CAMBND_set_item_app_data *
* *
* *
* PROGRAM DESCRIPTION - *
* This example requires an open part, a manufacturing setup, and *
* one or more highlighted geometry groups or operations. *
* *
/* Allow the user to select faces. */
while (TRUE)
{
UF_UI_select_with_single_dialog(cue_face, title,
UF_UI_SEL_SCOPE_NO_CHANGE, init_proc1, NULL,
&response, &eid, cursor, &view);
if (response == UF_UI_OBJECT_SELECTED)
{
entity_list[entity_count] = eid;
/* Allocate the memory for the boundary data of an item without app data. */
bnd_data_list[entity_count] = create_and_init_bnd_data(UF_CAM_boundary_type_closed,
1, origin, matrix,
UF_CAM_material_side_out_right,
0, 0, 0, NULL);
/* Append the face boundaries. */
if (entity_count > 0)
{
for(i=0; i<object_count; i++)
{
UF_OBJ_ask_type_and_subtype(objects, &type, &subtype);
/* The object type must be Operation or Geometry Group. */
if( type == UF_machining_operation_type || type == UF_machining_geometry_grp_type)
{
for (j=0; j<entity_count; j++)
{
/***********************************************************************/
/*
* UF_CAMBND_append_bnd_from_face
*/
/***********************************************************************/
UF_CAMBND_append_bnd_from_face(objects, UF_CAM_part,
entity_list[j], bnd_data_list[j]);
UF_CAMBND_append_bnd_from_face(objects, UF_CAM_blank,
entity_list[j], bnd_data_list[j]);
UF_CAMBND_append_bnd_from_face(objects, UF_CAM_check,
entity_list[j], bnd_data_list[j]);
UF_CAMBND_append_bnd_from_face(objects, UF_CAM_trim,
entity_list[j], bnd_data_list[j]);
}
}
}
}
/* Free the boundary data. */
for (i=0; i<entity_count; i++)
{
UF_free(bnd_data_list);
}
entity_count = 0;
/* Allow the user to select edges. */
while (TRUE)
{
UF_UI_select_with_single_dialog(cue_edge, title,
UF_UI_SEL_SCOPE_NO_CHANGE, init_proc2, NULL,
&response, &eid, cursor, &view);
static UF_CAMBND_boundary_data_p_t create_and_init_bnd_data
(
UF_CAM_boundary_type_t type,
int plane_type,
double *origin,
double *matrix,
UF_CAM_material_side_t material_side,
int ignore_holes,
int ignore_islands,
int ignore_chamfers,
UF_CAMBND_app_data_p_t app_data
)
{
UF_CAMBND_boundary_data_p_t bnd_data;
int i, err_code;