点击查看详细介绍

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

misnn 10年前 979 0

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


函数结构:
UF_DRAW_ask_group_of_curve
(
tag_t curve_tag,
tag_t * group_tag,
int * group_type,
int * group_subtype
)

函数说明:
鉴于曲线的标签,输出相关图纸成员视图曲线组,该组类型和子类型的标签。

函数参数:
第1个参数为输入:
curve_tag代表参数变量,tag_t 为输入参数类型,曲线标签

第2个参数为输出:
group_tag代表参数变量,tag_t * 为输出参数类型,绘制会员查看曲线组标签。该group_tag是一个NULL TAG如果曲线不是起草边缘。

第3个参数为输出:
输出int * 整数型的参数,参数的变量格式为group_type,绘制会员查看曲线组的类型,可以是:UF solid_silhouette_type,UF solid_section_type或UF_curve_group_type

第4个参数为输出:
输出int * 整数型的参数,参数的变量格式为group_subtype,绘制会员查看曲线组的亚型:如果组UF_solid_silhouette_type,无论是UF_solid_silhouette_sl_subtype,UF_solid_silhouette_uvhatch_subtype或UF_vicurve_subtype否则,如果组UF_curve_group_type,无论是UF_dropped_edge_group_subtype或UF_simplified_group_subtype否则=0

UF_DRAW_ask_group_of_curve函数实例代码演示:
这个例子在查询部分的所有曲线的曲线组信息。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_assem.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_drf_types.h>
#include <uf_obj.h>
#include <uf_object_types.h>
#include <uf_view.h>
#define N_ELEMENTS(array) (sizeof(array)/sizeof(array[0]))
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
int ndx;
int curve_group_type;
int curve_group_subtype;
int curve_types[]={UF_line_type,
UF_circle_type,
UF_conic_type,
UF_spline_type};
int num_curve_types =
N_ELEMENTS( curve_types );
tag_t curve_tag = NULL_TAG;
tag_t curve_group_tag = NULL_TAG;
char error_message[133];
ifail = UF_initialize();
for( ndx=0; ndx<num_curve_types; ndx++ )
{
/* Cycle all curves in the part.
Print out each curve's group. */
if( ifail == 0 )
ifail = UF_OBJ_cycle_objs_in_part(
UF_ASSEM_ask_work_part(),
curve_types[ndx], &curve_tag );

while( ( curve_tag != NULL_TAG ) && ( ifail == 0 ) )
{
ifail = UF_DRAW_ask_group_of_curve( curve_tag,
&curve_group_tag, &curve_group_type,
&curve_group_subtype );

if( ifail == 0 )
{
printf( "Curve %d ", curve_tag );
switch( curve_group_type )
{
case 0:
{
printf( "is not a drawing edge. \n" );
break;
}
case UF_solid_section_type:
{
printf( "of group %d is ",
curve_group_tag );
printf( "a section edge.\n" );
break;
}
case UF_solid_silhouette_type:
{
printf( "of group %d is ",
curve_group_tag );
if( curve_group_subtype ==
UF_solid_silhouette_sl_subtype )
printf( "a silhouette.\n" );
else if( curve_group_subtype ==
UF_solid_silhouette_uvhatch_subtype )
printf( "a uv hatch curve.\n" );
else if( curve_group_subtype ==
UF_vicurve_subtype )
printf( "a vicurve.\n" );
else
printf( "a silhouette.\n" );
break;
}
case UF_curve_group_type:
{
printf( "of group %d is ",
curve_group_tag );
if( curve_group_subtype ==
UF_dropped_group_subtype )
{
printf("an extracted drawing edge.\n");
}
else if( curve_group_subtype ==
UF_simplified_group_subtype )
{
printf("a simplified drawing edge.\n");
}
break;
}
default:
{
printf( "is not a drawing edge.\n" );
}
}

ifail = UF_OBJ_cycle_objs_in_part(
UF_ASSEM_ask_work_part(),
UF_line_type, &curve_tag );

}
}
}

printf( "UF_DRAW_ask_group_of_curve sample " );
if( ifail > 0 )
{
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );

ifail = UF_terminate();

}



[/quote]

0

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