购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRF_free_text( int num_text, UF_DRF_draft_aid_text_info_t * * text_info) 函数说明:
释放用于存储文本数据信息的存储器。
函数参数:
第1个参数为输入:
输入int 整数型的参数,参数的变量格式为num_text,文本字符串数
第2个参数为输入:
text_info代表参数变量,UF_DRF_draft_aid_text_info_t * * 为输入参数类型,指针数据结构,其中包含起草援助文本信息(见uf_drf_types.h)
UF_DRF_free_text函数实例代码演示:
在下面的示例中的代码查询起草援助文本数据信息,并使用后释放存储器。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_assem.h>
#include <uf_defs.h>
#include <uf_drf.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 = 0;
int num_text;
tag_t draft_aid_tag = NULL_TAG;
char error_message[133] = "";
UF_DRF_draft_aid_text_info_t *text_info = NULL;
/* Initialize User Function. */
ifail = UF_initialize();
/* Find the tag to a drafting entity. */
ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(),
UF_drafting_entity_type,
&draft_aid_tag );
if( !ifail && draft_aid_tag )
{
/* Retrieve the text information of the drafting entity. */
ifail = UF_DRF_ask_draft_aid_text_info ( draft_aid_tag,
&num_text,
&text_info );
if( !ifail )
{
/*Free the memory that contains the text information.*/
ifail = UF_DRF_free_text( num_text, &text_info );
}
}
printf( "UF_DRF_free_text " );
if( ifail )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );
UF_terminate();
}
[/quote]