NX二次开发-打开part对话框UF_UI_open_part
这是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的更多相关文章
- NX二次开发-打开文件夹,并同时选中指定文件
NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_part.h> #include <at ...
- NX二次开发-UFUN特征选择对话框UF_UI_select_feature
#include <uf.h> #include <uf_ui.h> UF_initialize(); //特征选择对话框 char sMessage[] = "特征 ...
- NX二次开发-打开弹出当前part所在的文件夹
#include <uf.h> #include <uf_part.h> #include <atlstr.h> #include <iostream> ...
- NX二次开发-使用MFC对话框不能用UF_UI_select等函数解决方法
VC/MFC调用UG Dialog要进入加锁状态 加锁 UF_UI_lock_ug_access ( UF_UI_FROM_CUSTOM ); 此处为UF_UI_select的函数 解锁 UF_UI_ ...
- NX二次开发-uc1600字符串对话框
NX9+VS2012 #include <uf.h> #include <uf_ui.h> UF_initialize(); char* cue = "输入框&quo ...
- NX二次开发-基于MFC界面对话框与NX交互的开发
打开VS2013 点击新建,选择MFC DLL 点击确定 点下一步 什么都不改,直接点完成 进来之后先编译一下,看是否编译成功 打开项目属性,更改这几处 $(UGII_BASE_DIR)\ugopen ...
- NX二次开发-BlockUI对话框嵌套MFC对话框制作进度条
半年前在一些QQ群看到有大神NX二次开发做出了进度条,那个时候我还不会弄,也不知道怎么弄得,后来断断续续得研究了一下,直到今天我把它做出来了.内心还是很喜悦的!回想自己这两年当初从没公司肯给我做NX二 ...
- NX二次开发-基于MFC界面的NX对Excel读写操作(OLE方式(COM组件))
NX二次开发API里没有对EXCAL读写操作的相关函数,市面上有很多种方法去实现,比如UFUN调KF,ODBC,OLE(COM组件)等等.这里我是用的OLE(COM组件)方式去做的,这种在VC上创建的 ...
- NX二次开发-UDO用户自定义对象(UFUN)【持续完善】
每当提起UDO总是会让我想起大专毕业那会失业找工作,后来有个宝贵机会去了软件公司上班,拿到了我人生中的第一个NX二次开发项目,一个关于测量汽车前后左右摄像头的项目.当时那个项目就用到了UDO,对于只看 ...
随机推荐
- python 数据的存储
数据的存储 思考:为什么使用计算机?存储数据,计算数据 思考:数据存在哪里?数据存储在内存里 思考:数据怎么在内存里存储的?首先弄明白怎么存储数字 1010.5“sunck is a good man ...
- Hbase速览
一.概述 理解为hadoop中的key-value存储,数据按列存储,基于HDFS和Zookeeper 1.应用 2.场景 适用场景: 存储格式:半结构化数据,结构化数据存储,Key-Value存储 ...
- leetcode-163周赛-1263-推箱子*
题目描述: 自己的提交: class Solution: def minPushBox(self, grid: List[List[str]]) -> int: driction = [(0,1 ...
- leetcode-160周赛-5239-循环码排列
题目描述: 参考格雷编码: class Solution: def circularPermutation(self, n: int, start: int) -> List[int]: res ...
- Java 基础 - 继承
子类继承父类的private字段么? Oracle的Java Documentation对Inheritance的定义: 很直白,定义里面就告诉你了这不叫继承.继承的意思是你可以对其进行直接的调用和修 ...
- Hello cnblog!
博主是从csdn搬过来的,原博客地址: https://blog.csdn.net/Cold_Chair 里面有一些不错的游记和知识点讲解,由于不方便搬过来,所以有兴趣的同学可以去看看(* ̄︶ ̄)
- 首次公开!单日600PB的计算力--阿里巴巴EB级大数据平台的进击
MaxCompute作为阿里巴巴的主力计算平台,在2018年的双11中,再次不负众望,经受住了双11期间海量数据和高并发量的考验.为集团的各条业务线提供了强劲的计算力,不愧是为阿里巴巴历年双11输送超 ...
- Yii2 使用十一 在设置enablePrettyUrl时候,defaultAction的设置方法
启用美化Url的功能 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableS ...
- 「题解」:$Six$
问题 A: Six 时间限制: 1 Sec 内存限制: 512 MB 题面 题面谢绝公开. 题解 来写一篇正经的题解. 每一个数对于答案的贡献与数本身无关,只与它包含了哪几个质因数有关. 所以考虑二 ...
- 思维构造+匹配——cf1199E
直接枚举每条边,如果边加到图中后还是个匹配图,就直接加,反之就不加 这样加完所有边后,剩下的点必定可以组成一个独立集:因为如果剩下的点中还有互相匹配的,那么这对点应该在加边时就被算到匹配图中 所以要么 ...