even2004: [二次开发] edit sphere parameter(use UF_MODL_edit #include <stdio.h> #include <string.h> #include <uf.h> #include <uf_modl.h> #include <uf_ui.h> #include <uf_object_types.h> #define UF_CALL(X) (report_error( __FILE__, __LINE__, #X, (X))) /*ARGSUSED*/ static int report_error( char *file, int line, char *call, int irc) { if (irc) { char err[133], msg[133]; sprintf(msg, "*** ERROR code %d at line %d in %s:n+++ ", irc, line, file); UF_get_fail_message(irc, err); /* NOTE: UF_print_syslog is new in V18 */ UF_print_syslog(msg, FALSE); UF_print_syslog(err, FALSE); UF_print_syslog("n", FALSE); UF_print_syslog(call, FALSE); UF_print_syslog(";n", FALSE); if (!UF_UI_open_listing_window()) { UF_UI_write_listing_window(msg); UF_UI_write_listing_window(err); UF_UI_write_listing_window("n"); UF_UI_write_listing_window(call); UF_UI_write_listing_window(";n"); } } return(irc); } #define WRITE(X) UF_UI_open_listing_window(); UF_UI_write_listing_window(X) /*ARGSUSED*/ static tag_t select_a_feature(char *prompt) { int cnt, resp;: tag_t first, *feats; $ UF_CALL(UF_UI_select_feature(prompt, NULL, &cnt, &feats, &resp)); if (cnt)' {1 O. first = feats[0];) UF_free(feats); return (first); } else return (NULL_TAG); } /*ARGSUSED*/ static logical prompt_for_a_number(char *prompt, char *item, double *number) {. int irc, resp; char menu[1][16]; double da[1]; strncpy(&menu[0][0], item, 16); menu[0][15] = ' |
|