iCAx开思工具箱

标题: 紧急求助:UG二次开发中的“拉伸到曲面” [打印本页]

作者: falconer    时间: 2007-7-27 12:09
标题: 紧急求助:UG二次开发中的“拉伸到曲面”
我想用OPenAPI实现“拉伸到曲面”的功能。首先创建一个曲面,再调用UF_MODL_create_extrusion函数。代码如下;
  int obj_cnt;
  char *offsets[2] = {"0.0", "0.0"};
  UF_FEATURE_SIGN mode_sign = UF_NULLSIGN;

  UF_MODL_SWEEP_TRIM_object_t trim_object;

  int i, num;
  uf_list_p_t  face_list;
  char *limits[2]={ "0", "30" };
  char *taper_angle="0.0";
  tag_t trim_objects[1],line1, line2, line3, line4,line5, line6, line7, line8;
  tag_t *objects, generators[8];
  double pt1[3],dir[3];
  UF_CURVE_line_t sline1, sline2, sline3, sline4,sline5, sline6, sline7, sline8;
  pt1[0]=0.0;
  pt1[1]=0.0;
  pt1[2]=0.0;
/* line#1 */
  sline1.start_point[0] = 40.0;
  sline1.start_point[1] = 30.0;
  sline1.start_point[2] = 0.0;
  sline1.end_point[0] = 48.0;
  sline1.end_point[1] = 30.0;
  sline1.end_point[2] = 0.0;
  UF_CALL(UF_CURVE_create_line(&sline1,&line1));
/* line#2 */
  sline2.start_point[0] = 48.0;
  sline2.start_point[1] = 30.0;
  sline2.start_point[2] = 0.0;
  sline2.end_point[0] = 48;
  sline2.end_point[1] = 38;
  sline2.end_point[2] = 0.0;
  UF_CALL(UF_CURVE_create_line(&sline2,&line2));

/* line#3 */
  sline3.start_point[0] = 48;
  sline3.start_point[1] = 38;
  sline3.start_point[2] = 0.0;
  sline3.end_point[0] = 40;
  sline3.end_point[1] = 38;
  sline3.end_point[2] = 0.0;
  UF_CALL(UF_CURVE_create_line(&sline3,&line3));
/* line#4 */
  sline4.start_point[0] = 40;
  sline4.start_point[1] = 38;
  sline4.start_point[2] = 0.0;
  sline4.end_point[0] = 40;
  sline4.end_point[1] = 30;
  sline4.end_point[2] = 0.0;
  UF_CALL(UF_CURVE_create_line(&sline4,&line4));

...............
  
  /* line 4 */
  generators[0] = line1;
  generators[1] = line2;
  generators[2] = line3;
  generators[3] = line4;

  generators[4] = line5;
  generators[5] = line6;
  generators[6] = line7;
  generators[7] = line8;


  dir[0]=0.0; dir[1]=0.0; dir[2]=1.0;

  trim_objects[0] = bsurf_obj_id;//bsurf_obj_id是已经生成的曲面的tag
  trim_object.trim_count = 1;
  trim_object.trim_objects = trim_objects;
  trim_object.sign =  UF_MODL_SWEEP_TRIM_TO_FACE;
  
  int code = UF_MODL_create_extrusion(generators, 8, &trim_object,
                                   taper_angle,limits,offsets,
                                   pt1, false, true, dir,
                                   mode_sign,&objects,&obj_cnt);
  char mass[133];
  UF_get_fail_message(code,mass);
  uc1601(mass,1);

  UF_free(objects);



结果报错“不能创建修剪的扫掠体”

我是新手,请大家帮忙看一下这段程序有什么错误!多谢了!!!!


作者: falconer    时间: 2007-7-27 12:11
拜托大家~~~~~·
作者: richard_buaa    时间: 2009-3-22 11:55
大约2年后,有一个我遇到了跟你一模一样的问题,也是“cannot create sweep trim body”,呵呵,找到这个帖子感觉很亲切:)能交流一下吗?sunelse@yahoo.cn




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