- 积分
- 6
- 注册时间
- 2003-6-24
- 仿真币
-
- 最后登录
- 1970-1-1
|
请二次开发高手帮我看看这个函数,为什么分网不成?
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。这是为什么?请大侠指点!多谢!
附件可以直接运行, |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|