这是UFUN帮助的官方例子

 /******************************************************************************
Copyright (c) 1999 Unigraphics Solutions, Inc.
Unpublished - All Rights Reserved *******************************************************************************/
/* The following example demonstrates how to invoke
UF_UI_open_part. */
/* ***** Include Files ***** */
#include <stdio.h>
#include <string.h>
#include <uf.h>
#include <uf_part.h>
#include <uf_ui.h>
/* ***** Local Prototype ***** */
static logical my_error_handler
(
UF_UI_err_data_p_t error_fn_data,
char *file_name,
int error,
UF_PART_load_status_t *error_status,
logical *skip_error_disp
);
/* ***** Entry Point ***** */
/*ARGSUSED*/
extern void ufusr(char *param, int *ret_code, int len)
{
/*
*********************
variable declarations
*********************
*/
int response;
tag_t part_tag = NULL_TAG;
char file_name[MAX_FSPEC_SIZE + ] = "flange.prt";
const char *message = "part open error";
logical use_display_file = FALSE;
UF_PART_load_status_t part_status;
UF_UI_err_t error_handler; /*
************************************************
initialize the 'struct' as an open part 'struct'
and assign the local function prototyped above
as the callback
************************************************
*/
error_handler.type = UF_UI_open_part_fun;
error_handler.fun.open = my_error_handler;
/*
************************************************
assign the client data and its size
Note: this is an arbitrary usage of the client
data. A better use might be to pass the name of
a UIStyler dialog which would then be invoked in
the callback
************************************************
*/
error_handler.fun_data.size = strlen(message) + ;
error_handler.fun_data.data = message;
/*
*************************************************
call the function, free any allocated memory
*************************************************
*/
UF_initialize();
UF_UI_open_part(&error_handler, file_name,
&use_display_file,
&part_tag, &response, &part_status);
if (part_status.statuses != NULL)
{
UF_free(part_status.statuses);
}
if (part_status.file_names != NULL)
{
UF_free_string_array(part_status.n_parts,
part_status.file_names);
}
UF_terminate();
}
/* ***** local function to be invoked as a callback ***** */
static logical my_error_handler
(
UF_UI_err_data_p_t error_fn_data,
char *file_name,
int error,
UF_PART_load_status_t *error_status,
logical *skip_error_disp
)
{
/*
***************************************************
this function trivially just prints the client data
that it receives as well as the file name and the
error
As mentioned above, a better usage of the client
data would be to pass through the name of a
UIStyler dialog to display. Such a use might
resemble the following:
UF_STYLER_create_dialog (
( char * ) error_fn_data->data ,
callbacks ,
n_callbacks ,
NULL ,
&response );
***************************************************
*/
fprintf(stderr, "my_error_handler called with:\n"
" error_fn_data->size = %d\n"
" error_fn_data->data = %s\n"
" file_name = %s\n"
" error = %d\n",
error_fn_data->size,
(const char *)error_fn_data->data,
file_name,
error
);
/* **************************************************
instruct NX to display its error dialog and to
continue looping within the dialog until a part
is opened
**************************************************
*/
*skip_error_disp = TRUE;
return TRUE;
}

NX二次开发-打开part对话框UF_UI_open_part的更多相关文章

  1. NX二次开发-打开文件夹,并同时选中指定文件

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_part.h> #include <at ...

  2. NX二次开发-UFUN特征选择对话框UF_UI_select_feature

    #include <uf.h> #include <uf_ui.h> UF_initialize(); //特征选择对话框 char sMessage[] = "特征 ...

  3. NX二次开发-打开弹出当前part所在的文件夹

    #include <uf.h> #include <uf_part.h> #include <atlstr.h> #include <iostream> ...

  4. NX二次开发-使用MFC对话框不能用UF_UI_select等函数解决方法

    VC/MFC调用UG Dialog要进入加锁状态 加锁 UF_UI_lock_ug_access ( UF_UI_FROM_CUSTOM ); 此处为UF_UI_select的函数 解锁 UF_UI_ ...

  5. NX二次开发-uc1600字符串对话框

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> UF_initialize(); char* cue = "输入框&quo ...

  6. NX二次开发-基于MFC界面对话框与NX交互的开发

    打开VS2013 点击新建,选择MFC DLL 点击确定 点下一步 什么都不改,直接点完成 进来之后先编译一下,看是否编译成功 打开项目属性,更改这几处 $(UGII_BASE_DIR)\ugopen ...

  7. NX二次开发-BlockUI对话框嵌套MFC对话框制作进度条

    半年前在一些QQ群看到有大神NX二次开发做出了进度条,那个时候我还不会弄,也不知道怎么弄得,后来断断续续得研究了一下,直到今天我把它做出来了.内心还是很喜悦的!回想自己这两年当初从没公司肯给我做NX二 ...

  8. NX二次开发-基于MFC界面的NX对Excel读写操作(OLE方式(COM组件))

    NX二次开发API里没有对EXCAL读写操作的相关函数,市面上有很多种方法去实现,比如UFUN调KF,ODBC,OLE(COM组件)等等.这里我是用的OLE(COM组件)方式去做的,这种在VC上创建的 ...

  9. NX二次开发-UDO用户自定义对象(UFUN)【持续完善】

    每当提起UDO总是会让我想起大专毕业那会失业找工作,后来有个宝贵机会去了软件公司上班,拿到了我人生中的第一个NX二次开发项目,一个关于测量汽车前后左右摄像头的项目.当时那个项目就用到了UDO,对于只看 ...

随机推荐

  1. Vue学习笔记【26】——Vue路由(什么是路由)

    什么是路由 后端路由:对于普通的网站,所有的超链接都是URL地址,所有的URL地址都对应服务器上对应的资源,这个对应关系就是后端中的路由: 前端路由:对于单页面应用程序来说,主要通过URL中的hash ...

  2. Vue学习笔记【13】——键盘修饰符以及自定义键盘修饰符

    1.x版本中自定义键盘修饰符[了解] Vue.directive('on').keyCodes.f2 = 113; 2.x版本中自定义键盘修饰符 通过Vue.config.keyCodes.名称 = ...

  3. 埃氏筛+线段树——cf731F

    从2e5-1依次枚举每个数作为主显卡,然后分段求比它大的数的个数,这里的复杂度是调和级数ln2e5,即埃氏筛的复杂度.. #include<bits/stdc++.h> using nam ...

  4. 高级运维(三):部署Lnmp环境、构建Lnmp平台、地址重写

    一.部署LNMP环境 目标: 安装部署Nginx.MariaDB.PHP环境 1> 安装部署Nginx.MariaDB.PHP.PHP-FPM: 2> 启动Nginx.MariaDB.FP ...

  5. CF 1097D - Hello 2019 D题: Makoto and a Blackboard

    目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:传送门  Portal  原题目描述在最下面.  给一个数n ...

  6. js中的函数声明和函数表达式的区别

    目录 一.声明与表达式的格式 1.1 声明式的格式: 1.2 表达式的格式: 二.区别 2.1 函数表达式可以直接在后面加括号执行,而函数声明不可以. 2.2 函数表达式可以被提前解析出来 2.3 命 ...

  7. golang 读取 ini配置信息

      package main //BY: 29295842@qq.com//这个有一定问题   如果配置信息里有中文就不行//[Server] ;MYSQL配置//Server=localhost   ...

  8. nodejs moment 修改时间格式 日期格式与时间戳格式互相转化

    node js moment 修改时间格式 日期格式与int格式互相转化 nvm use 8.3 > moment = require('moment') > days = '2019-0 ...

  9. QinQ 技术解析

    目录 1. 概述 2. QinQ 的产生背景 3. QinQ的作用及原理 4. QinQ 技术的优点 5. QinQ 的报文结构 6. QinQ的实现方式 (1) 基本QinQ (2) 灵活QinQ ...

  10. pair的用法

    如何定义?(初始化) 1. pair<int,int>p; 2.定义即初始化,也可以这个样子 pair<,); 里面的类型还可以是string,double等. 3.还可以这样子初始 ...