点击查看详细介绍

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

misnn 7年前 699 0

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


函数结构:
UF_DRF_ask_boundaries
(
tag_t draft_aid_tag,
int * num_boundaries,
tag_p_t * boundary_tags
)

函数说明:
返回边界的标签与相关联的数字,并鉴于边界指定的输入标签。

函数参数:
第1个参数为输入:
draft_aid_tag代表参数变量,tag_t 为输入参数类型,该地区的标签填充或交叉线对象

第2个参数为输出:
输出int * 整数型的参数,参数的变量格式为num_boundaries,边界数

第3个参数为输出:
boundary_tags代表参数变量,tag_p_t * 为输出参数类型,其中包含边界的标签的数组。该数组必须通过调用UF_free释放。

UF_DRF_ask_boundaries函数实例代码演示:
在下面的例子中,代码查询边界数,和边界的标签。
[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 type, subtype, num_boundaries;
tag_t boundary_tag = NULL_TAG;
tag_p_t boundary_tags;
char error_message[133] = "";
/* Initialize NX Open API. */
ifail = UF_initialize();
/* Get an annotation type */
ifail = UF_OBJ_cycle_objs_in_part( UF_ASSEM_ask_work_part(),
UF_drafting_entity_type,
&boundary_tag );
while( !ifail && boundary_tag )
{
/* Get object subtype */
ifail = UF_OBJ_ask_type_and_subtype( boundary_tag, &type,
&subtype );
if( !ifail && ( subtype == UF_draft_crosshatch_subtype ||
subtype == UF_draft_area_fill_subtype ||
subtype == UF_draft_solid_fill_subtype ))
{
ifail = UF_DRF_ask_boundaries( boundary_tag,
&num_boundaries,
&boundary_tags );
}
/* Find the tag of next drafting entity. */
if ( !ifail )
ifail = UF_OBJ_cycle_objs_in_part(
UF_ASSEM_ask_work_part(),
UF_drafting_entity_type,
&boundary_tag );
}
printf( "UF_DRF_ask_boundaries sample " );
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)
请登录后发表新帖