iCAx开思网

标题: API如何设置实体的默认颜色为白色? [打印本页]

作者: C22CH    时间: 2009-3-17 12:28
标题: API如何设置实体的默认颜色为白色?
API如何设置实体的默认颜色为白色?
有这个函数吗?
作者: C22CH    时间: 2009-3-17 13:02
我的目的是设置实体的默认颜色是白色,透明度是50

我用UF_OBJ_set_cre_color(70,0,0,1);颜色设置失败

默认透明的函数没有找到
作者: C22CH    时间: 2009-3-17 13:26
改默认颜色的我搞定了,但还没有找到设置默认透明的函数
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <uf.h>
  5. #include <uf_ui.h>
  6. #include <uf_modl.h>
  7. #include <uf_object_types.h>
  8. #include <uf_obj.h>

  9. #define UF_CALL(X) (report_error( __FILE__, __LINE__, #X, (X)))

  10. static int report_error( char *file, int line, char *call, int irc)
  11. {
  12.         if (irc)
  13.         {
  14.                 char err[133],
  15.                         msg[133];

  16.                 sprintf(msg, "*** ERROR code %d at line %d in %s:\n+++ ",
  17.                         irc, line, file);
  18.                 UF_get_fail_message(irc, err);

  19.                 /*  NOTE:  UF_print_syslog is new in V18 */

  20.                 UF_print_syslog(msg, FALSE);
  21.                 UF_print_syslog(err, FALSE);
  22.                 UF_print_syslog("\n", FALSE);
  23.                 UF_print_syslog(call, FALSE);
  24.                 UF_print_syslog(";\n", FALSE);

  25.                 if (!UF_UI_open_listing_window())
  26.                 {
  27.                         UF_UI_write_listing_window(msg);
  28.                         UF_UI_write_listing_window(err);
  29.                         UF_UI_write_listing_window("\n");
  30.                         UF_UI_write_listing_window(call);
  31.                         UF_UI_write_listing_window(";\n");
  32.                 }
  33.         }

  34.         return(irc);
  35. }

  36. static void do_it(void)
  37. {
  38.         UF_CALL(UF_OBJ_set_cre_color(UF_solid_type, UF_all_subtype,
  39.                 UF_OBJ_solid_body_property, UF_OBJ_PURPLE));
  40. }


  41. void ufusr(char *param, int *retcode, int paramLen)
  42. {
  43.         if (UF_CALL(UF_initialize())) return;
  44.         do_it();
  45.         UF_terminate();
  46. }

  47. int ufusr_ask_unload(void)
  48. {
  49.         return (UF_UNLOAD_IMMEDIATELY);
  50. }

复制代码





欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3