购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_PART_ask_compression_flags( tag_t part, UF_PART_compress_flags_p_t compress_mask) 函数说明:
读取部分文件的压缩标志。如果标准领域该UF_PART_compress_flags_s结构是真实的,那么一部分,当被保存,它保存在压缩格式。
函数参数:
第1个参数为输入:
part代表参数变量,tag_t 为输入参数类型,部分询问压缩标志
第2个参数为输出:
compress_mask代表参数变量,UF_PART_compress_flags_p_t 为输出参数类型,压缩标志设置位字段
UF_PART_ask_compression_flags函数实例代码演示:
这个例子需要一个工作的一部分。这个例子,并打印压缩标志的状态。如果压缩是关闭的,它是打开的。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_assem.h>
#include <uf_part.h>
#include <uf_ui.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
static int report( char *file, int line, char *call, int irc)
{
if (irc)
{
char messg[133];
printf("%s, line %d: %s\n", file, line, call);
(UF_get_fail_message(irc, messg)) ?
printf(" returned a %d\n", irc) :
printf(" returned error %d: %s\n", irc, messg);
}
return(irc);
}
static void do_ugopen_api(void)
{
char buffer[UF_UI_MAX_STRING_LEN+1];
char err_msg[MAX_LINE_SIZE+1];
int err = 0;
tag_t part;
UF_PART_compress_flags_t compress;
/* Open the Information Window for messages. */
UF_CALL(UF_UI_open_listing_window());
/* Get the part tag of the work part. */
part = UF_ASSEM_ask_work_part();
/* Continue execution if the part tag is valid. */
if(part != NULL_TAG)
{
/* Get the compression flag. */
if(!UF_CALL(UF_PART_ask_compression_flags(part, &compress)))
{
/* If the standard field is true, print a message saying
the flag is set. Otherwise, print a message saying the
flag is off and set the flag to on.
*/
if(compress.standard)
{
UF_UI_write_listing_window(
"The compression flag is on.\n");
}
else
{
UF_UI_write_listing_window(
"The compression flag is off.\n");
compress.standard = TRUE;
if(!UF_CALL(UF_PART_set_compression_flags(part,
&compress)))
{
UF_UI_write_listing_window(
"The compression flag has been set.\n");
}
}
}
}
else
{
UF_UI_write_listing_window(
"Couldn't get tag of the work part.\n");
}
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int param_len)
{
if (!UF_CALL(UF_initialize()))
{
do_ugopen_api();
UF_CALL(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}
[/quote]