点击查看详细介绍

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

misnn 9年前 507 0

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


函数结构:
UF_DRF_is_object_out_of_date
(
tag_t object,
logical * out_of_date
)

函数说明:
查询对象的向上的最新状态。目前,只有两种类型对象都是有效的:观点和图纸。

函数参数:
第1个参数为输入:
object代表参数变量,tag_t 为输入参数类型,视图或图纸查询

第2个参数为输出:
out_of_date代表参数变量,logical * 为输出参数类型,对象的状态,TRUE如果对象是过时的。

UF_DRF_is_object_out_of_date函数实例代码演示:
在下面的示例中的代码更新out_of_date图纸或视图当前部分。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_obj.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
char drawing_name[MAX_ENTITY_NAME_SIZE + 1] = "";
char view_name [MAX_ENTITY_NAME_SIZE + 1] = "";
char error_message[133];
tag_t view_tag = NULL_TAG;
tag_t drawing_tag = NULL_TAG;
logical out_of_date;
ifail = UF_initialize();
if (ifail == 0)
{
ifail = UF_DRAW_ask_current_drawing(&drawing_tag);
}
if ( ifail == 0 && drawing_tag != NULL_TAG )
{

ifail = UF_OBJ_ask_name( drawing_tag, drawing_name );
}
if (ifail == 0)
{
/* Get the name of the drawing's first view. */
ifail = uc6499 (drawing_name, view_name);
}
if (ifail == 0)
{
/* Get the view's tag. */
ifail = UF_VIEW_ask_tag_of_view_name (view_name,
&view_tag);
}
if (ifail == 0)
{
/* Query the drawing's out of date status. */
ifail = UF_DRAW_is_object_out_of_date(drawing_tag,
&out_of_date);
}
if (ifail == 0 && out_of_date && view_tag != NULL_TAG)
{
/* Update the view. */
ifail = UF_DRAW_update_one_view(drawing_tag,view_tag);
}
printf ("UF_DRAW_update_one_view sample ");

if (ifail != 0)
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );
UF_terminate();
}


[/quote]

0

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