/****************************************************************************** Copyright (c) 1999 Unigraphics Solutions, Inc. Unpublished - All Rights Reserved *******************************************************************************/ /* The code in the following example queries the user symbol font information, and frees the memory after usage. */ #include #include #include #include #include #include #include #include void ufusr(char *param, int *retcod, int param_len) { int ifail = 0; int num_symbols; int type, subtype; tag_t ud_symbol_tag = NULL_TAG; char error_message[133] = ""; UF_DRF_ud_symbol_font_info_t *font_info = NULL; /* Initialize User Function. */ ifail = UF_initialize(); /* Find the tag of a drafting entity. */ ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(), UF_drafting_entity_type, &ud_symbol_tag ); while( !ifail && ud_symbol_tag ) { ifail = UF_OBJ_ask_type_and_subtype( ud_symbol_tag, &type, &subtype ); /* Retrieve the User Defined Symbol font information. */ if( !ifail && subtype == UF_draft_user_defined_subtype ) { ifail = UF_DRF_ask_ud_symbol_font_info( ud_symbol_tag, &num_symbols, &font_info ); /* Free the memory containing the font information. */ if( !ifail ) ifail = UF_DRF_free_font( num_symbols, &font_info); } /* Find the tag of a drafting entity. */ if ( !ifail ) ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(), UF_drafting_entity_type, &ud_symbol_tag ); } printf( "UF_DRF_free_font " ); 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(); }