点击查看详细介绍

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

misnn 7年前 762 0

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


函数结构:
UF_DRF_create_offctrpt_fy
(
UF_DRF_object_p_t cline_object,
UF_DRF_object_p_t center_point,
tag_t* offctrpt_tag
)

函数说明:
创建并显示在y轴偏移中心点和计算的偏移距离(“中心线”类型UF_DRF_offctrpt_fy)。

函数参数:
第1个参数为输入:
cline_object代表参数变量,UF_DRF_object_p_t 为输入参数类型,相关中心线对象(见uf_drf_types.h)有效的对象类型:弧形,弧形实线

第2个参数为输入:
center_point代表参数变量,UF_DRF_object_p_t 为输入参数类型,选择计算距离的物体的数据以将抵消中心点使用(见uf_drf_types.h)

第3个参数为输出:
offctrpt_tag代表参数变量,tag_t* 为输出参数类型,创建偏移中心点的对象标记

UF_DRF_create_offctrpt_fy函数实例代码演示:
本实施例对在x轴上产生偏移中心点从电弧正常指定的距离。
[quote]
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_curve.h>
#include <uf_csys.h>
void ufusr(char *param, int *retcod, int param_len)
{
int status = 0;
static double distance = 2.0;
char stat_msg[133];
tag_t wcs, arc1_tag, arc2_tag;
tag_t cl1_tag, cl2_tag, cl3_tag, cl4_tag, cl5_tag, cl6_tag;
UF_CURVE_arc_t arc_coords;
UF_DRF_object_t object, center;
status = UF_initialize();
if (!status)
{
/* initialize the object structures */
UF_DRF_init_object_structure(&object);
UF_DRF_init_object_structure(¢er);
/* create two arcs */
UF_CSYS_ask_wcs(&wcs);
UF_CSYS_ask_matrix_of_object(wcs, &arc_coords.matrix_tag);
arc_coords.start_angle = 0.0;
arc_coords.end_angle = TWOPI;
arc_coords.arc_center[0] = 5.0;
arc_coords.arc_center[1] = 0.0;
arc_coords.arc_center[2] = 0.0;
arc_coords.radius = 2.0;
status = UF_CURVE_create_arc(&arc_coords, &arc1_tag);
}
if (!status)
{
arc_coords.arc_center[0] = -5.0;
status = UF_CURVE_create_arc(&arc_coords, &arc2_tag);
}
if (!status)
{
object.object_tag = arc1_tag;
object.object_view_tag = NULL_TAG;
object.object_assoc_type = UF_DRF_arc_center;
object.object_assoc_modifier = 0;
center.object_tag = arc2_tag;
center.object_view_tag = NULL_TAG;
center.object_assoc_type = UF_DRF_arc_center;
center.object_assoc_modifier = 0;
/* create an offset center point,
x-axis: distance from arc normal */
status = UF_DRF_create_offctrpt_nx(&object, distance,
&cl1_tag);
}
if (!status)
/* create an offset center point,
y-axis: distance from arc normal */
status = UF_DRF_create_offctrpt_ny(&object, distance,
&cl2_tag);
if (!status)
/* create an offset center point,
x-axis: distance from arc center */
status = UF_DRF_create_offctrpt_cx(&object, distance,
&cl3_tag);
if (!status)
/* create an offset center point,
y-axis: distance from arc center */
status = UF_DRF_create_offctrpt_cy(&object, distance,
&cl4_tag);
if (!status)
/* create an offset center point,
x-axis: calculate (find) distance */
status = UF_DRF_create_offctrpt_fx(&object, ¢er,
&cl5_tag);
if (!status)
/* create an offset center point,
y-axis: calculate (find) distance */
status = UF_DRF_create_offctrpt_fy(&object, ¢er,
&cl6_tag);
printf("UF_DRF_create_offctrpt_nx,_ny,_cx,_cy,_fx,_fy ");
if (status)
{
UF_get_fail_message(status, stat_msg);
printf("have ERROR %d: %s.\n", status, stat_msg);
}
else
printf("are successful.\n");

UF_terminate();
}



[/quote]

0

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