/****************************************************************************** Copyright (c) 1999 Unigraphics Solutions, Inc. Unpublished - All Rights Reserved *******************************************************************************/ /* The code in the following example queries the number of boundaries, and the tags of the boundaries. */ #include #include #include #include #include #include #include #include void ufusr(char *param, int *retcod, int param_len) { int ifail = 0; int type, subtype, num_boundaries; tag_t boundary_tag = NULL_TAG; tag_p_t boundary_tags; char error_message[133] = ""; /* Initialize UG/Open API. */ ifail = UF_initialize(); /* Get an annotation type */ ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(), UF_drafting_entity_type, &boundary_tag ); while( !ifail && boundary_tag ) { /* Get object subtype */ ifail = UF_OBJ_ask_type_and_subtype( boundary_tag, &type, &subtype ); if( !ifail && ( subtype == UF_draft_crosshatch_subtype || subtype == UF_draft_area_fill_subtype || subtype == UF_draft_solid_fill_subtype )) { ifail = UF_DRF_ask_boundaries( boundary_tag, &num_boundaries, &boundary_tags ); } /* Find the tag of next drafting entity. */ if ( !ifail ) ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(), UF_drafting_entity_type, &boundary_tag ); } printf( "UF_DRF_ask_boundaries sample " ); if( ifail ) { ifail = UF_get_fail_message( ifail, error_message ); printf( "fails.\nError is: %s\n", error_message ); } else printf( "is successful.\n" ); UF_terminate(); }