点击查看详细介绍

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

misnn 9年前 865 0

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


函数结构:
UF_DRAW_redefine_sxline_hinge
(
tag_t sxline_tag,
UF_DRF_line_object_p_t hinge_line,
logical arrow_same_dir
)

函数说明:
重新定义了部分线路的铰线提供段线的标签和起草线对象。剖面视图及的任何细节剖视图重新取向有关它们的中心,以反映新定义铰线。要在不更新执行上的分割线此编辑,使用抑制UF_DRF_set_suppress_view_update提供了查看更新的功能。注:hinge_line.line_assoc_type必须是UF_DRF_dwg_line,UF_DRF_existing_line或UF_DRF_two_points。如果hinge_line.line_assoc_type是UF_DRF_dwg_line,铰链线有没有关联性,并通过从所限定的方向矢量定义的hinge_line.object1.assoc_dwg_pos到hinge_line.point_object2.assoc_dwg_pos。

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

第2个参数为输入:
hinge_line代表参数变量,UF_DRF_line_object_p_t 为输入参数类型,反对关联铰线

第3个参数为输入:
arrow_same_dir代表参数变量,logical 为输入参数类型,如果为true,新的箭头方向将指向从新的枢纽线走在相同的相对方向老箭头所指从老铰线了。否则,该方向被翻转。

UF_DRAW_redefine_sxline_hinge函数实例代码演示:
此示例程序演示了如何使用UF_DRAW_redefine_sxline铰链。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_assem.h>
#include <uf_draw.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_drf_types.h>
#include <uf_obj.h>
#include <uf_object_types.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
tag_t sxline_tag = NULL_TAG;
tag_t edge1_tag = NULL_TAG;
tag_t arc1_tag = NULL_TAG;
tag_t arc2_tag = NULL_TAG;
char* edge1_name = "edge1";
char* arc1_name = "arc1";
char* arc2_name = "arc2";
char error_message[133];
UF_DRF_line_object_t hinge_line;
ifail = UF_initialize();
if( !ifail )
{
/* Loop through all the part entities counting
the number of section lines
and of those how many are invalid. */
ifail = UF_OBJ_cycle_objs_in_part(
UF_ASSEM_ask_work_part(),
UF_section_line_type, &sxline_tag);
}
if( !ifail )
{
UF_DRF_init_line_object( &hinge_line );
hinge_line.line_assoc_type = UF_DRF_DWG_LINE;
hinge_line.object1.assoc_dwg_pos[0] = 0.0;
hinge_line.object1.assoc_dwg_pos[1] = 0.0;
hinge_line.point_object2.assoc_dwg_pos[0] = 1.0;
hinge_line.point_object2.assoc_dwg_pos[1] = 1.0;
/* Redefine the hinge line, defined by two points
on the drawing. */
ifail = UF_DRAW_redefine_sxline_hinge(
sxline_tag, &hinge_line, TRUE );
}
if( !ifail )
{
/* Redefine the hinge line again. This time
associate it to a model edge. */
UF_OBJ_cycle_by_name ( edge1_name, &edge1_tag );
UF_DRF_init_line_object( &hinge_line );
hinge_line.line_assoc_type = UF_DRF_EXISTING_LINE;
hinge_line.object1.object_tag = edge1_tag;
ifail = UF_DRAW_redefine_sxline_hinge(
sxline_tag, &hinge_line, TRUE );
}
if( !ifail )
{
/* Redefine the hinge line again. This time
associate using the two points method
by designating two arc centers. */
UF_OBJ_cycle_by_name( arc1_name, &arc1_tag );
UF_OBJ_cycle_by_name( arc2_name, &arc2_tag );
UF_DRF_init_line_object( &hinge_line );
hinge_line.line_assoc_type = UF_DRF_TWO_POINTS;
hinge_line.object1.object_tag = arc1_tag;
hinge_line.object1.object_assoc_type = UF_DRF_arc_center;
hinge_line.point_object2.object_tag = arc2_tag;
hinge_line.point_object2.object_assoc_type =
UF_DRF_arc_center;
ifail = UF_DRAW_redefine_sxline_hinge(
sxline_tag, &hinge_line, TRUE );
}
printf( "UF_DRAW_redefine_sxline_hinge sample " );
if( ifail )
{
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)
请登录后发表新帖