购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRAW_ask_bound_by_objects( const tag_t view_tag, int* num_objects, tag_t* * bounded_objects) 函数说明:
检索视图的有限对象。
函数参数:
第1个参数为输入:
view_tag代表参数变量,const tag_t 为输入参数类型,看标签,其模型的参考点是要得到。
第2个参数为输出:
输出int* 整数型的参数,参数的变量格式为num_objects,指针为int表示返回的对象标签的数量。
第3个参数为输出:
bounded_objects代表参数变量,tag_t* * 为输出参数类型,指针标记用于计算视图边界边框对象数组。免费使用()在完成时释放该数组。
UF_DRAW_ask_bound_by_objects函数实例代码演示:
本示例检索成员鉴于界定对象的列表,TOP@1。
[quote]
#include <stdlib.h>
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_obj.h>
#include <uf_part.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
tag_t view_tag = NULL_TAG;
tag_t part_tag = NULL_TAG;
tag_t *object_tags = NULL;
int num_objects = 0;
char *view_name = "TOP@1";
char error_message[133];
ifail = UF_initialize();
if( !ifail )
part_tag = UF_PART_ask_display_part();
if( !ifail && part_tag != NULL_TAG )
ifail = UF_VIEW_ask_tag_of_view_name( view_name,
&view_tag );
if( !ifail && part_tag != NULL_TAG &&
view_tag != NULL_TAG )
ifail = UF_DRAW_ask_bound_by_objects( view_tag,
&num_objects,
&object_tags );
/* Code could be inserted here to use some of the objects *
* to redefine the view boundary. */
printf( "UF_DRAW_ask_bound_by_objects " );
if( ifail )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails. \nError is:%s\n", error_message );
}
else if( part_tag == NULL_TAG )
printf( "fails.\nError is: no active part.\n" );
else if ( view_tag == NULL_TAG )
printf( "fails.\nError is: view not found.\n" );
else
printf( "is successful.\n" );
UF_free( object_tags );
ifail = UF_terminate();
}
[/quote]