购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRAW_ask_boundary_type( const tag_t view_tag, UF_DRAW_boundary_type_t * boundary_type) 函数说明:
检索视图的边界类型。
函数参数:
第1个参数为输入:
view_tag代表参数变量,const tag_t 为输入参数类型,看标签,其模型的参考点是要得到。
第2个参数为输出:
boundary_type代表参数变量,UF_DRAW_boundary_type_t * 为输出参数类型,边界类型的成员观点:UF_DRAW_BREAK_DETAIL_TYPE,UF DRAW_MANUAL_RECTANGLE_TYPE,UF DRAW_AUTOMATIC_RECTANGLE_TYPE,UF DRAW_BOUND_BY_OBJECTS_TYPE
UF_DRAW_ask_boundary_type函数实例代码演示:
本示例检索@1边界类型的成员来看,TOP。
[quote]
#include <stdlib.h>
#include <stdio.h>
#include <uf_part.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.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;
char error_message[133];
char * view_name= "TOP@1";
UF_DRAW_boundary_type_t boundary_type;
ifail = UF_initialize();
if( !ifail )
part_tag = UF_PART_ask_display_part();
if( !ifail && part_tag != NULL_TAG )
/* get view tag of TOP view */
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_boundary_type( view_tag,
&boundary_type);
if( !ifail )
switch( boundary_type )
{
case UF_DRAW_BREAK_DETAIL_TYPE:
printf( "Break line detail type. \n" );
break;
case UF_DRAW_MANUAL_RECTANGLE_TYPE:
printf( "Manual rectangle type. \n" );
break;
case UF_DRAW_AUTOMATIC_RECTANGLE_TYPE:
printf( "Automatic rectangle type. \n" );
break;
case UF_DRAW_BOUND_BY_OBJECTS_TYPE:
printf( "Bound by objects type. \n" );
break;
default:
break;
}
printf( "UF_DRAW_ask_boundary_type " );
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 );
ifail = UF_terminate();
}
[/quote]