/****************************************************************************** Copyright (c) 1999 Unigraphics Solutions, Inc. Unpublished - All Rights Reserved *******************************************************************************/ /* The code in the following example queries the dimension information and frees the pointer after usage. */ #include #include #include #include #include #include #include #include void ufusr(char *param, int *retcod, int param_len) { char error_message[133] = ""; int ifail = 0; tag_t dim_tag = NULL_TAG; int dim_type; double dim_origin[ 3 ]; UF_DRF_dim_info_t *dim_info = NULL; /* Initialize User Function. */ ifail = UF_initialize(); /* Retrieve a dimension type */ ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(), UF_dimension_type, &dim_tag ); /* Retrieve dimension information */ while( !ifail && dim_tag ) { { ifail = UF_DRF_ask_dim_info ( dim_tag, &dim_type, &dim_origin[ 0 ], &dim_info ); /* Free the dimension information memory */ if( !ifail ) UF_DRF_free_dimension( &dim_info ); } /* Retrieve a dimension type */ ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(), UF_dimension_type, &dim_tag ); } printf( "UF_DRF_free_dimension " ); 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(); }