点击查看详细介绍

UF_UI_select_single() 函数的参数解释说明、函数详细用法,以及实例代码演示

misnn 7年前 1187 0

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


函数结构:
UF_UI_select_single
(
char * message,
UF_UI_selection_options_p_t opts,
int * response,
tag_p_t object,
double cursor [ 3 ],
tag_p_t view
)

函数说明:
此功能在不久的将来会过时。 请使用替换常规UF_UI_select_with_single_dialog。选择一个对象。视图参数是指向视图序列。这个标签提供了从该对象是视图选中。

函数参数:
第1个参数为输入:
输入char * 字符类型的参数,参数的变量格式为message,显示提示线的消息。

第2个参数为输入:
opts代表参数变量,UF_UI_selection_options_p_t 为输入参数类型,选择选项。请参阅本章的数据结构部分。

第3个参数为输出:
输出int * 整数型的参数,参数的变量格式为response,回应:1 =2返回=取消按名称5=对象选择4 =对象中选择

第4个参数为输出:
object代表参数变量,tag_p_t 为输出参数类型,所选对象的对象标识符

第5个参数为输出:
输出double 双精度类型的参数,参数的变量格式为cursor [ 3 ],光标位置。这是不确定的,如果反应是4(按名称选择的对象)。

第6个参数为输出:
view代表参数变量,tag_p_t 为输出参数类型,查看选择。这是空Tag如果响应为4(按名称选择的对象)。

UF_UI_select_single函数实例代码演示:
[quote]
#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_solid_type;
opts.mask_triples->object_subtype = 0;
opts.mask_triples->solid_type = UF_UI_SEL_FEATURE_BODY;
/* 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();
}



[/quote]

0

最新回复 (0)
请登录后发表新帖