找回密码
 注册
Simdroid-非首页
查看: 134|回复: 0

[E. 单元/节点] 【讨论】二次开发,网格划分时,获得的节点总数为何时0?

[复制链接]
发表于 2004-3-19 21:37:21 | 显示全部楼层 |阅读模式 来自 江西南昌
请二次开发高手帮我看看这个函数,为什么分网不成?
  
static void do_ugopen_api(void)  
{  
  char cue[] = "Select Objects";  
  char title[] = "User Title";  
  int response, count, i;  
  tag_t *object_id;  
  char buffer[200];  
  
  UF_SF_AMM_mesh_parameters_t mesh_params; /* <I> Mesh-parameters of 2d mesh*/  
  char *element_type="Tri3";        /*<I> element type. Has to be one of  
                    //   the following fouruad8, Quad4, Tri6, Tri3 */  
  int num_objects=1; /*<I> number of objects to mesh */  
// tag_t *object_id;     /*<I> Tag of the object to be meshed 前面已经定义了。 */  
  tag_t mesh_tag;           /*<O> */  
  int number_of_nodes;  
   
    if((UF_CALL(UF_UI_select_with_class_dialog(cue, title, UF_UI_SEL_SCOPE_WORK_PART,  
          NULL, NULL, &response, &count, &object_id))) == 0)  
    { UF_CALL(UF_UI_open_listing_window());  
    sprintf(buffer,"object count = %d\n",count);  
        UF_CALL(UF_UI_write_listing_window(buffer));  
         if (response == UF_UI_OK && count > 0)  
         {  
             for (i=0; i<count; i++)  
             {  
         sprintf(buffer,"object tag = %d\n", object_id);  
         UF_CALL(UF_UI_write_listing_window(buffer));  
                 UF_DISP_set_highlight(object_id, 0);  
             }  
  
            // UF_free(object_id);  
         }  
    }  
  mesh_params.mesh_dimension=UF_SF_DIMENSION_2D;  
  mesh_params.midnode_needed=0;  
  mesh_params.overall_elem_size=4;  
  mesh_params.quad_splitting=0;  
  UF_CALL(UF_SF_create_2d_ansys_mesh(&mesh_params,element_type,count,object_id,&mesh_tag));  
  UF_free(object_id);  
  UF_CALL(UF_SF_count_nodes(mesh_tag,&number_of_nodes));  
  sprintf(buffer,"number of nodes is : = %d\n", number_of_nodes);  
  UF_CALL(UF_UI_write_listing_window(buffer));  
}  
  
编译、链接和运行都可以,启动ug18后,先打开一个sheet零件件,进入modeling,然后调用该程序生成的mesh_ansys_2d.dll,选择该sheet进行网格划分,最后出错,而且节点数为0。这是为什么?请大侠指点!多谢!  
  
附件可以直接运行,

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-23 22:29 , Processed in 0.036244 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表