iCAx开思网

标题: UGAPI选择EDGE [打印本页]

作者: asku88    时间: 2008-6-1 11:33
标题: UGAPI选择EDGE
我按照帮助里面的例子修改的,却始终选择不到实体的EDGE!
帮忙看看哪里错了

#include <stdio.h>
#include <uf.h>
#include <uf_ui.h>
#include <uf_object_types.h>
#include <uf_disp.h>
void ufusr(char *param, int *retcod, int param_len)
{
int irc = 0;
char *message = "Select Object";
UF_UI_selection_options_t opts;
UF_UI_mask_t mask;
int response;
tag_t object, view;
double cursor[3];
char error[133];
int unhighlight=0;

UF_initialize();
opts.other_options = 0;
opts.reserved = NULL;
opts.num_mask_triples = 1;
opts.mask_triples = &mask;
/* set up selectable type, subtype, solid type */
opts.mask_triples->object_type = UF_edge_type;
opts.mask_triples->object_subtype = 0;

/* set selection scope to be work part */
opts.scope = UF_UI_SEL_SCOPE_WORK_PART;
irc = UF_UI_select_single(message,&opts,&response,
                          &object,cursor,&view);
/* if no error, print information about selected object */
if (!irc)
{
  printf("response= %d, object tag= %d, view tag= %d, cursor
    position= %f %f %f\n", response, object, view, cursor[0],
    cursor[1],cursor[2]);
  /* unhighlight selected object */
  FTN(uf1640)(&object,&unhighlight);
}
else  /* else get error message */
{
  UF_get_fail_message(irc,error);
  printf("ERROR: %s\n",error);
}
UF_terminate();
}
作者: sac807    时间: 2008-6-1 16:01
更改为下面三条
opts.mask_triples->object_type = UF_solid_type;
opts.mask_triples->object_subtype = 0;
opts.mask_triples->solid_type = UF_UI_SEL_FEATURE_ANY_EDGE;

UF_edge_type这个子类型已经作废了。
作者: asku88    时间: 2008-6-2 09:07
非常感谢楼上的,我马上试试
作者: supergirl    时间: 2008-6-2 11:30
opts.mask_triples->object_type = UF_solid_type;
    opts.mask_triples->object_subtype = UF_solid_edge_subtype;
   opts.mask_triples->solid_type=UF_UI_SEL_FEATURE_ANY_EDGE;




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