购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRAW_ask_sxline_sxseg( tag_t sxseg_tag, UF_DRAW_sxseg_info_t * sxseg_info, tag_t * curve_tag, UF_DRF_object_p_t * object) 函数说明:
检索部分线段的信息,给出的标签部分线段。
函数参数:
第1个参数为输入:
sxseg_tag代表参数变量,tag_t 为输入参数类型,部分的线段的标签来查询
第2个参数为输出:
sxseg_info代表参数变量,UF_DRAW_sxseg_info_t * 为输出参数类型,分部信息
第3个参数为输出:
curve_tag代表参数变量,tag_t * 为输出参数类型,段曲线标签
第4个参数为输出:
object代表参数变量,UF_DRF_object_p_t * 为输出参数类型,对象相关联的细分。免费使用,以释放内存。
UF_DRAW_ask_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;
int seg_ndx;
int len;
tag_t sxline1_tag;
tag_t pview_tag;
tag_t dwg_tag;
tag_t curve_tag;
tag_t new_sxview_tag;
tag_t * sxview_tags = NULL;
tag_t * sxseg_tags = NULL;
double step_dir[3];
double arrow_dir[3];
double view_placement_pt[2];
double sxview_scale = 1.0;
char error_message[133];
char * sxline1 = "half_sxline1";
char dwg_name[MAX_FSPEC_SIZE +1];
char sxview_name[MAX_FSPEC_SIZE +1];
UF_DRAW_sxline_status_t sxline_status;
UF_DRAW_sxseg_info_t sxseg_info;
UF_DRF_object_p_t object = NULL;
UF_DRAW_half_sxsegs_t half_sxseg_objects;
ifail = UF_initialize();
if( !ifail )
{
/* Find the tag of the section line from its name. */
numchrs = strlen( sxline1 );
ifail = uc5028( sxline1, numchrs, &sxline1_tag );
}
if( !ifail )
{
/* Retrieve information about a half section line. */
ifail = UF_DRAW_ask_half_sxline( sxline1_tag,
step_dir, arrow_dir, &pview_tag, &num_sxviews,
&sxview_tags, &num_sxsegs, &sxseg_tags,
&sxline_status );
}
if( !ifail )
{
/* Read current drawing name. */
ifail = uc6492( dwg_name );
}
if( !ifail )
{
/* Get section view name from its tag. */
ifail = uc5027( sxview_tags[0], sxview_name, &len );
}
if( !ifail )
{
/* Find the drawing location of the section view. */
ifail = uc6483( dwg_name, sxview_name, view_placement_pt );
}
if( !ifail )
{
/* Get the section line segment information. */
for( seg_ndx = 0; seg_ndx < num_sxsegs; seg_ndx++ )
{
ifail = UF_DRAW_ask_sxline_sxseg( sxseg_tags[seg_ndx],
&sxseg_info, &curve_tag, &object );
if( ifail ) break;
if( sxseg_info.sxseg_type == UF_DRAW_sxseg_bend )
half_sxseg_objects.bend_object = object;
else if( sxseg_info.sxseg_type == UF_DRAW_sxseg_cut )
half_sxseg_objects.cut_object = object;
else
UF_free( object );
}
}
if( !ifail )
{
/* The system will generate the arrow. */
half_sxseg_objects.arrow_object = NULL;
num_sxsegs = 2;
/* Get tag from drawing name. */
len = strlen( dwg_name );
ifail = uc5028( dwg_name, len, &dwg_tag );
}
/* Create a similar half section line. */
if( !ifail )
{
ifail = UF_DRAW_create_half_sxview( dwg_tag,
sxview_scale,step_dir, arrow_dir, pview_tag,
num_sxsegs, &half_sxseg_objects,
view_placement_pt, &new_sxview_tag );
}
/* Free the object structures and arrays. */
UF_free( half_sxseg_objects.bend_object );
UF_free( half_sxseg_objects.cut_object );
UF_free( sxview_tags );
UF_free( sxseg_tags );
printf( "UF_DRAW_create_half_sxview 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]