购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_VIEW_ask_vde_data( tag_t object, int * number_edits, UF_VIEW_vde_data_p_t * vde_data) 函数说明:
检索查看相关编辑的编号为对象,并且对于每个修改相应的数据。
函数参数:
第1个参数为输入:
object代表参数变量,tag_t 为输入参数类型,对象的标签
第2个参数为输出:
输出int * 整数型的参数,参数的变量格式为number_edits,为对象视图相关编辑的数量。
第3个参数为输出:
vde_data代表参数变量,UF_VIEW_vde_data_p_t * 为输出参数类型,包含视图,颜色,字体,宽度和范围内的每个视图相关编辑的VDE结构数组。使用UF_free()来释放内存。
UF_VIEW_ask_vde_data函数实例代码演示:
在下面的例子中的代码检索视图相关编辑名为对象,“NMD OBJ”。
[quote]
#include <stdlib.h>
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_obj.h>
#include <uf_part.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
int inx = 0;
int number_edits = 0;
tag_t object = NULL_TAG;
tag_t part_tag = NULL_TAG;
char *object_name = "NMDOBJ";
char error_message[133];
UF_DRAW_vde_data_p_t vde_data;
ifail = UF_initialize();
if( ifail == 0 )
part_tag = UF_PART_ask_display_part();
if( ifail == 0 && part_tag != NULL_TAG )
ifail = UF_OBJ_cycle_by_name( object_name, &object );
if( ifail == 0 && object != NULL_TAG )
ifail = UF_VIEW_ask_vde_data( object,
&number_edits,
&vde_data );
if( ifail == 0 )
for( inx = 0; inx < number_edits; inx++ )
{
printf( "\nFor inx = %d, view_tag = %d\n,
inx, vde_data[inx].view_tag );
printf( "Parameter range = %f to %f\n",
vde_data[inx].start_parameter,
vde_data[inx].end_parameter );
printf( "color = %d, font = %d, width = %d\n",
vde_data[inx].color,
vde_data[inx].font,
vde_data[inx].width );
/* Code to manage edit can go here */
}
UF_free( vde_data );
printf( "UF_VIEW_ask_vde_data() " );
if( ifail != 0 )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else if ( part_tag == NULL_TAG )
printf( "fails.\nError is: no active part.\n" );
else if ( object == NULL_TAG )
printf( "fails.\nError is: named object not found.\n" );
else
printf( "is successful, number of edits = %d.\n", number_edits );
UF_terminate();
}
[/quote]