/*=================================================================== Copyright (c) 2002 Unigraphics Solutions Corporation Unpublished - All rights reserved ===================================================================*/ /****************************************************************************** * * * DESCRIPTION - * * This program shows how to use the following Open API routines: * * * * UF_DIE_ask_draw_faces * * UF_DIE_ask_material_properties * * * * PROGRAM DESCRIPTION - * * The following example requires an open part containing one of each of * * the following features: * * DIE_BINDER_RING * * DIE_FACE * * and a product sheet body with material properites associated. * * * * This function will make three calls to UF_DIE_ask_draw_faces, * * one for each of the types of faces we want to find and highlight * * each set of faces with an informational message. Finally, it * * will make a call to UF_DIE_ask_material_properties to find the sheet * * metal thickness and material properties and display the thickness * * and material name in an infomrational message. * * * * * ******************************************************************************/ #include #include #include #include #include #include #include #define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X))) static int report( char *file, int line, char *call, int irc) { if (irc) { char messg[133]; printf("%s, line %d: %s\n", file, line, call); (UF_get_fail_message(irc, messg)) ? printf(" returned a %d\n", irc) : printf(" returned error %d: %s\n", irc, messg); } return(irc); } static void do_ugopen_api(void) { tag_t material_type_tag, *faces; double metal_thickness; int num_faces, response, ii; int highlight = 1, unhighlight = 0; char *binder_faces_msg = "Binder Ring faces are highlighted"; char *punch_faces_msg = "Die Punch faces are highlighted"; char *die_face_faces_msg = "Die Face faces are highlighted"; char material_msg[MAX_LINE_SIZE+1], *string_msg; char *material_name; UF_SF_material_prop_t material_properties; /* Find faces for binder ring */ UF_CALL(UF_DIE_ask_draw_faces(0, /* ask for binder ring faces */ &num_faces, &faces)); /* Highlight faces for binder ring */ for (ii=0; ii