iCAx开思网
标题:
UG 二次开发 标注 选择问题
[打印本页]
作者:
olympic
时间:
2010-2-6 01:37
标题:
UG 二次开发 标注 选择问题
我想写个程序.出UG的孔位表 .
只想出我选择的.UG 里有个命令,可以出全部的,但不适合
现在的问题是.假如,我想标注两条边之间的距离尺寸,我要手动选择的话,
用UG open c , 我无论如何都不能选择.肯定是我函数用错了.
目前我用的形式如下:
tatic int init_proc_curve(UF_UI_selection_p_t select, void* user_data)
{
int num_triples = 5;
UF_UI_mask_t mask_triples[] =
{
UF_line_type, 0, 0,
UF_circle_type, 0, 0,
UF_conic_type, 0, 0,
UF_spline_type, 0, 0,
UF_solid_type, 0, UF_UI_SEL_FEATURE_ANY_EDGE
};
// enable only solid body
UF_UI_set_sel_mask(
select,
UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,
num_triples,
mask_triples
);
return (UF_UI_SEL_SUCCESS);
}
int select_draft(tag_t select[], int *body_no)
{
char cue[] = "选择所有曲线";
char title[] = "选择所有曲线";
int response, count, i;
tag_p_t objects;
UF_UI_select_with_class_dialog(cue,title,UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY,init_proc_curve,NULL,&response,&count,&objects);
if (count > 0 && count < 100) //write out info & turn off highlight
{
*body_no = count;
for(i = 0; i < count; i++)
select = objects;
response = 100;
}
if (count > 0)
for(i = 0; i < count; i++)
UF_DISP_set_highlight(objects, 0);
UF_free(objects);
return response;
}
复制代码
本帖最后由 olympic 于 2010-2-6 01:39 编辑
作者:
ssy871120
时间:
2012-11-12 17:08
在选择函数前加UF_UI_set_cursor_view()
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3