/* The code in the following internal UG/Open API example prints the work plane emphasis dim color to standard out. */ #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) { int color; char *color_name; double color_triples[3]; UF_CALL(UF_DISP_ask_work_plane_dim_clr(&color)); UF_CALL(UF_DISP_ask_color(color, UF_DISP_rgb_model, &color_name, color_triples)); printf("Work plane plane emphasis dim color is %s\n", color_name); UF_free(color_name); } /*ARGSUSED*/ void ufusr(char *param, int *retcode, int paramLen) { if (!UF_CALL(UF_initialize())) { do_ugopen_api(); UF_CALL(UF_terminate()); } } int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }