NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_modl.h> #include <uf_ui_ont.h> #include <uf_param.h> #include <uf_param_indices.h> #include <uf_object_types.h> #include <uf_obj.h> static int select_filter_proc_fn(tag_t object, int type[3], void* user_data, UF_UI_selection_p_t select) { if (object == NULL) { return UF_UI_SEL_REJECT; } else { return UF_UI_SEL_ACCEPT; } } static int init_proc(UF_UI_selection_p_t select, void* user_data) { int num_triples = 1;//可选类型的数量 UF_UI_mask_t mask_triples[] = {UF_solid_type, UF_all_subtype, UF_UI_SEL_FEATURE_PLANAR_FACE};//可选对象类型 UF_UI_set_sel_mask(select, UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC, num_triples, mask_triples); if ((UF_UI_set_sel_procs(select, select_filter_proc_fn, NULL, user_data)) == 0) { return UF_UI_SEL_SUCCESS; } else { return UF_UI_SEL_FAILURE; } } UF_initialize(); //获取当前加工导航器选中的对象数量和TAG int count = 0; tag_t* objects = NULL_TAG; UF_UI_ONT_ask_selected_nodes(&count, &objects); for (int i = 0; i < count; i++) { tag_t operTag = objects[i]; //单对象选择对话框 char sCue[] = "单对象选择对话框"; char sTitle[] = "单对象选择对话框"; int iScope = UF_UI_SEL_SCOPE_NO_CHANGE; int iResponse; tag_t faceTag = NULL_TAG; tag_t tView = NULL_TAG; double adCursor[3]; UF_UI_select_with_single_dialog(sCue, sTitle, iScope, init_proc, NULL, &iResponse, &faceTag, adCursor, &tView); //获得面的原点和向量 int Type; double Point[3]; double Dir[3]; double Box[6]; double Radius[3]; double RadData[3]; int NormDir; UF_MODL_ask_face_data(faceTag, &Type, Point, Dir, Box, Radius, RadData, &NormDir); //创建基准平面 tag_t plane_tag=NULL_TAG; UF_MODL_create_plane(Point, Dir, &plane_tag); //设置操作的底面 UF_PARAM_set_tag_value(operTag, UF_PARAM_FLOOR, plane_tag); //隐藏 UF_OBJ_set_blank_status(plane_tag, UF_OBJ_BLANKED); } //释放 UF_free(objects); UF_terminate(); Caesar卢尚宇 2020年5月25日
NX CAM二次开发-UF_PARAM_set_tag_value设置操作的底面
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
WPS二次开发系列:WPS SDK功能效果展示
WPS二次开发,WPS SDk功能效果展示
Word WPS 二次开发 Office -
NX二次开发UF_CAM_ask_clear_plane_tag 函数介绍
查询清洁飞机的标签。
java 开发语言 二次开发 #include UI -
NX二次开发UF_CAM_PREF_ask_logical_value 函数介绍
此函数提供指定 CAM 首选项的逻辑设置。
java 开发语言 NX二次开发 UG二次开发 数据库 -
NX二次开发UF_CAM_PREF_ask_integer_value 函数介绍
此函数提供指定 CAM 首选项的整数值。
java 开发语言 NX二次开发 UG二次开发 数据库 -
NX二次开发UF_CAM_ask_cam_preferences 函数介绍
此函数提供 CAM 首选项的当前设置。
java 开发语言 二次开发 #include UI -
NX二次开发UF_CAM_ask_lower_limit_plane_tag 函数介绍
查询下限平面的标记。
java jvm 开发语言 二次开发 #include -
NX二次开发UF_CAM_init_session 函数介绍
此函数根据 $UGII _ CAM _ CONFIG 指定的配置文件的内容初始化当前 CAM 会话。如果 CAM 会话当前存在,则首先卸载它。
java 开发语言 二次开发 #include UI -
NX二次开发UF_CAM_opt_ask_types 函数介绍
此函数提供可用的对象参数模板类型的名称。
java 数据库 jvm NX二次开发 UG二次开发 -
NX二次开发UF_CAM_ask_leastsq_sphere 函数介绍
描述: 这个效用函数计算给定一组点的最小二乘球的中心点和半径。
java 开发语言 二次开发 #include UI -
NX二次开发UF_CAM_ask_config_file 函数介绍
此函数提供当前 CAM 会话中使用的 CAM 配置文件的名称。
java jvm 开发语言 二次开发 #include -
NX二次开发UF_CAM_opt_ask_subtypes 函数介绍
此函数提供指定的对象参数类型的可用对象参数模板子类型的名称。只返回具有指定的对象参数模板子类的子类型。
java 数据库 jvm NX二次开发 UG二次开发