iCAx开思工具箱

标题: UF_CSYS_ask_matrix_of_object?请键盘兄看看 [打印本页]

作者: yuwan    时间: 2005-8-18 21:22
标题: UF_CSYS_ask_matrix_of_object?请键盘兄看看
static void do_ugopen_api(void)
{
    char cue[] = "Select Objects";
    char title[] = "User Title";
    int response, count, i;
    tag_p_t objects;
  tag_t matrix;
  double values[9];
  
    /* Use multiple class selection with scope set to any object
       in the work part and without using an initialization procedure.
    */
    if((UF_CALL(UF_UI_select_with_class_dialog(
          cue, title, UF_UI_SEL_SCOPE_WORK_PART,
          NULL, NULL, &response, &count, &objects))) == 0)
    {
         printf("object count = %d\n",count);
         if (response == UF_UI_OK && count > 0)
         {
             for (i=0; i<count; i++)
             {
                 printf("object tag = %d\n", objects);
                 UF_DISP_set_highlight(objects, 0);
             }
         }
    }
  
    UF_CSYS_ask_matrix_of_object(objects[0],[$matrix)]
    UF_CSYS_ask_matrix_values(matrix,values);
        UF_free(objects);
      
  UF_UI_open_listing_window();
  for(i=0;i<=9;i++)
  {
    sprintf(buf,"%f\n",values);
    UF_UI_write_listing_window(buf);
  }
  
出来的数值:
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559631349317831000000000000000000000000000000000000000000000.000000
-92559592117431994000000000000000000000000000000000000000000000.000000
不知道哪里错了
作者: 深夜摔键盘    时间: 2005-8-18 21:54
检查 一下UF_CSYS_ask_matrix_of_object(objects[0],[$matrix)] 得到的matrix是不是NULL_TAG
作者: ljbest    时间: 2005-8-18 22:26
因为你这个对象没有matrix
作者: yuwan    时间: 2005-8-19 11:26
点了一个block实体也不行吗
作者: 深夜摔键盘    时间: 2005-8-20 09:28
好好的研究一下文档啊。文档里说的很清楚,有些对象是永远都没有Matrix的,有些对象你并没有将矩阵与它相连接,这些对象,你调用这个函数只能得到NULL_TAG;
  
Gets the matrix identifier attached to an object. An object does not
necessarily have an matrix attached to it, and some objects can never have
a matrix attached. This routine will return a NULL_TAG for the matrix
identifier if the object does not have a matrix attached to it, even if the
object can never have a matrix attached to it.




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3