点击查看详细介绍

UF_DRF_ask_assoc_exp() 函数的参数解释说明、函数详细用法,以及实例代码演示

misnn 9年前 1325 0

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


函数结构:
UF_DRF_ask_assoc_exp
(
tag_t object_tag,
tag_t * exp_tag
)

函数说明:
得到的表达,如果它存在,关联到指定的尺寸。如果存在与指定维度相关联的表达,这函数返回它的标签。如果没有与关联的表达指定尺寸,则返回NULL_TAG。

函数参数:
第1个参数为输入:
object_tag代表参数变量,tag_t 为输入参数类型,尺寸的标签。

第2个参数为输出:
exp_tag代表参数变量,tag_t * 为输出参数类型,关联到指定的输入对象标记表达的标记。

UF_DRF_ask_assoc_exp函数实例代码演示:
该函数UF_DRF_ask_assoc_expThis程序的测试程序,通过所有部件的电流环会议并打印尺寸及其相关的标签表达式,如果发现任何与相关的尺寸表达式。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_modl.h>
#include <uf_obj.h>
#include <uf_object_types.h>
#include <uf_part.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = UF_DRF_NO_ERRORS;
char error_message[MAX_LINE_SIZE+1];
char part_fspec[MAX_FSPEC_SIZE+1];
int dim_rm_type = UF_dimension_type;
tag_t dim_tag, exp_tag;
tag_t part;
int num_parts, current;
char *exp_string;
ifail = UF_initialize();
if( !ifail )
{
num_parts = UF_PART_ask_num_parts();
for ( current = 0 ; current < num_parts; current++)
{
/* Get the next part */
part = UF_PART_ask_nth_part( current );
UF_PART_ask_part_name( part, part_fspec );
printf( "Searching part %s for dimensions associated to
expressions\n", part_fspec );

dim_tag = NULL_TAG;
/* Get a dimension */
ifail = UF_OBJ_cycle_objs_in_part( part , dim_rm_type,
&dim_tag );
while ( !ifail && dim_tag )
{
/* See if dimension has an expression */
ifail = UF_DRF_ask_assoc_exp( dim_tag, &exp_tag );
if ( !ifail && exp_tag )
{
/* Dimension has expression, get the string */
ifail = UF_MODL_ask_exp_tag_string( exp_tag,
&exp_string );
if ( !ifail )
{
printf( "Dimension %u is associated to
expression %u, string = %s\n",d
im_tag,
exp_tag, exp_string );
UF_free( exp_string );
}
}
if ( !ifail )
{
/* Get another dimension */
ifail = UF_OBJ_cycle_objs_in_part( part,
dim_rm_type, &dim_tag );
}
} /* End while */
/* If there was an error, don't continue looping
through parts */
if ( ifail )
break;
} /* End loop of parts */
}
if( ifail )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "Printing all expressions fails.\nError is: %s\n",
error_message );
}
ifail = UF_terminate();
}



[/quote]

0

最新回复 (0)
请登录后发表新帖