点击查看详细介绍

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

misnn 7年前 571 0

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


函数结构:
UF_DRF_free_centerline
(
UF_DRF_centerline_info_t * * centerline_info
)

函数说明:
释放用于存储中心线数据存储器。

函数参数:
第1个参数为输入:
centerline_info代表参数变量,UF_DRF_centerline_info_t * * 为输入参数类型,中线信息(见uf_drf_types.h)

UF_DRF_free_centerline函数实例代码演示:
在下面的示例中的代码查询中心线的信息,并释放指针中心线的数据。
[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 subtype, type;
tag_t centerline_tag = NULL_TAG;
char error_message[133] = "";
double centerline_origin[ 3 ];
UF_DRF_valid_cline_form_t centerline_type;
UF_DRF_centerline_info_t *centerline = 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,
¢erline_tag );
/* Retrieve the object subtype. */
if( !ifail && centerline_tag )
{
ifail = UF_OBJ_ask_type_and_subtype( centerline_tag,
&type, &subtype );
}

/* Test centerline subtype. */
if( !ifail && ( subtype >= UF_draft_linear_cntrln_subtype
&& subtype <= UF_draft_sym_cntrln_subtype ))
{
ifail = UF_DRF_ask_centerline_info ( centerline_tag,
¢erline_type,
¢erline_origin[0],
¢erline );
/* Free the memory that contains centerline information.*/
if( !ifail )
{
UF_DRF_free_centerline( ¢erline );
}
}
printf( "UF_DRF_free_centerline " );
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]

0

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