购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRAW_move_sxline_sxseg( tag_t sxseg_tag, UF_DRF_object_p_t new_object) 函数说明:
移动的部分线段到由输入定义的位置new_object,然后更新所有的部分生产线的相关部分的意见位于当前图形上。不相关的部分意见在当前图形标记过时。要执行的编辑部分线路没有更新,请使用抑制视图更新功能在UF_DRF_set_suppress_view_update提供。 数字。移动部分线段
函数参数:
第1个参数为输入:
sxseg_tag代表参数变量,tag_t 为输入参数类型,部分线段标记移动。
第2个参数为输入:
new_object代表参数变量,UF_DRF_object_p_t 为输入参数类型,新对象关联段。
UF_DRAW_move_sxline_sxseg函数实例代码演示:
下面的例子中移动的切断线的截面段。
[quote]
#include <stdio.h>
#include <string.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_drf_types.h>
#include <uf_obj.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
int numchrs;
int num_sxviews;
int num_sxsegs;
tag_t sxline1_tag;
tag_t pview_tag;
tag_t curve_tag;
tag_t * sxview_tags = NULL;
tag_t * sxseg_tags = NULL;
double step_dir[3];
double arrow_dir[3];
char error_message[133];
char * sxline1 = "step_sxline1";
UF_DRAW_sxline_status_t sxline_status;
UF_DRF_object_p_t object;
UF_DRAW_sxseg_info_t sxseg_info;
ifail = UF_initialize();
if( !ifail )
{
/* Find the tag of a section line from its name. */
numchrs = strlen( sxline1 );
ifail = uc5028( sxline1, numchrs, &sxline1_tag );
}
if( !ifail )
{
/* Retrieve stepped section line information. */
ifail = UF_DRAW_ask_stepped_sxline( sxline1_tag,
step_dir, arrow_dir, &pview_tag, &num_sxviews,
&sxview_tags, &num_sxsegs, &sxseg_tags,
&sxline_status );
}
if( !ifail )
{
/* Retrieve sxseg information. */
ifail = UF_DRAW_ask_sxline_sxseg( sxseg_tags[1],
&sxseg_info, &curve_tag, &object );
}
if( !ifail )
{
/* Move the newly created segment. */
object->object_tag = NULL_TAG;
object->object_view_tag = NULL_TAG;
object->object_assoc_type = UF_DRF_dwg_pos;
object->object_assoc_modifier = UF_DRF_assoc_type_none;
object->assoc_dwg_pos[0] = object->assoc_dwg_pos[0] + .05;
object->assoc_dwg_pos[1] = object->assoc_dwg_pos[1] + .05;
ifail = UF_DRAW_move_sxline_sxseg( sxseg_tags[1], object );
}
UF_free( object );
UF_free( sxview_tags );
UF_free( sxseg_tags );
printf( "UF_DRAW_move_sxline_sxseg 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]