UF_UI_select_with_single_dialog
Defined in: uf_ui.h
*int UF_UI_select_with_single_dialog(char * message, char * title, int scope, UF_UI_sel_init_fn_t init_proc, void user_data, int * response, tag_t * object, double cursor [ 3 ] , tag_t * view )**
overview 概述
Selects a single object with the single selection dialog. The object can be selected with the cursor or by entering a name. The object is highlighted.
The valid selection scopes are defined in uf_ui.h (e.g UF_UI_SEL_SCOPE_NO_CHANGE). If the selection scope is changed, it is restored to its original state when the dialog is terminated.
The selection initialization procedure is a function the Open C API programmer can optionally provide in order to customize their selection by calling other UF_UI selection functions. NX calls the selection initialization procedure, passing the selection pointer and user data. The selection pointer is only valid during the selection initialization procedure, and is used as an input argument to the UF_UI selection functions.
If the initialization is successful, the procedure should return UF_UI_SEL_SUCCESS. Otherwise, it should return UF_UI_SEL_FAILURE. In this case, the single selection dialog is presented and an appropriate error code is returned. In the selection initialization procedure:
UF_UI_set_sel_mask can be called to specify object type filtering. The default object type mask is all standard types selectable.
UF_UI_set_sel_procs can be called to specify a filter procedure and/or selection callback.
You can call UF_UI_select_with_single_dialog in a loop to select multiple objects. The user indicates they are done selecting by choosing OK. You must have an active part to call this function.
The function UF_UI_set_cursor_view is necessary to enable the selection of objects within drawing member views.
使用单个选择对话框选择单个对象。可以使用光标或通过输入名称选择对象。该对象突出显示。有效的选择范围在 UF _ ui.h 中定义(例如 UF _ UI _ SEL _ SCOPE _ NO _ CHOGE)。如果选择范围发生更改,则在对话框终止时将其恢复到原始状态。选择初始化过程是 Open C API 程序员为了通过调用其他 UF _ UI 选择函数来自定义其选择而可以选择提供的一个函数。NX 调用选择初始化过程,传递选择指针和用户数据。选择指针仅在选择初始化过程中有效,用作 UF _ UI 选择函数的输入参数。如果初始化成功,过程应该返回 UF _ UI _ SEL _ SUCCESS。否则,它应该返回 UF _ UI _ SEL _ FAILURE。在这种情况下,将显示单个选择对话框并返回适当的错误代码。在选择初始化过程中: 可以调用 UF _ UI _ set _ sel _ block 来指定对象类型筛选。默认的对象类型掩码是所有可选择的标准类型。可以调用 UF _ UI _ set _ sel _ procs 来指定筛选过程和/或选择回调。可以在循环中调用 UF _ UI _ select _ with _ single _ Dialogue 来选择多个对象。用户通过选择 OK 表示已完成选择。必须有一个活动部分才能调用此函数。函数 UF _ UI _ set _ cursor _ view 对于在绘图成员视图中选择对象是必需的。
UFUN例子
获取源码例子请搜索 里海NX二次开发3000例专栏
parameters 参数
| char * | message | Input | Cue line message to display 显示提示线消息 |
| char * | title | Input | Dialog title or NULL 对话框标题或空 |
| int | scope | Input | Selection scope UF_UI_SEL_SCOPE_NO_CHANGE UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY UF_UI_SEL_SCOPE_WORK_PART UF_UI_SEL_SCOPE_WORK_PART_AND_OCC 选择范围 UF _ UI _ SEL _ SCOPE _ NO _ ChangGE UF _ UI _ SEL _ SCOPE _ any _ IN _ Assembly UF _ UI _ SEL _ SCOPE _ work _ Part UF _ UI _ SEL _ SCOPE _ Work _ Part _ AND _ OCC |
| UF_UI_sel_init_fn_t | init_proc | Input | Selection initialization procedure or NULL 选择初始化过程或 NULL |
| void* | user_data | Input | User data for initialization procedure or NULL 初始化过程的用户数据或 NULL |
| int * | response | Output | UF_UI_BACK UF_UI_CANCEL UF_UI_OK UF_UI_OBJECT_SELECTED UF_UI_OBJECT_SELECTED_BY_NAME 取消 UF _ UI _ OK UF _ UI _ OBJECT _ SELECTED UF _ UI _ OBJECT _ SELECTED _ BY _ NAME |
| tag_t * | object | Output | Selected object or NULL_TAG if no object selected 如果没有选定对象,则选定对象或 NULL _ TAG |
| double | cursor [ 3 ] | Output | Absolute coordinates of cursor position. This is undefined if object is selected by name. 光标位置的绝对坐标。如果按名称选择对象,则未定义此坐标。 |
| tag_t * | view | Output | View object was selected in. This is NULL_TAG if object was selected by name. 视图对象已被选中。如果对象按名称选中,则为 NULL _ TAG。 |