点击查看详细介绍

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

misnn 6年前 1340 0

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


函数结构:
UF_DRF_create_label
(
int num_lines_text,
char text_string [ ] [ MAX_LINE_LENGTH+1 ],
double origin_3d [ 3 ],
UF_DRF_leader_attach_type_t leader_attach_type,
UF_DRF_object_p_t object,
double model_pos_3d [ 3 ],
tag_t* label_tag
)

函数说明:
创建并显示一个标签。

函数参数:
第1个参数为输入:
输入int 整数型的参数,参数的变量格式为num_lines_text,文本行数

第2个参数为输入:
输入char 字符类型的参数,参数的变量格式为text_string [ ] [ MAX_LINE_LENGTH+1 ],相关的文本字符串

第3个参数为输入:
输入double 双精度类型的参数,参数的变量格式为origin_3d [ 3 ],在WCS坐标3D对象原点

第4个参数为输入:
leader_attach_type代表参数变量,UF_DRF_leader_attach_type_t 为输入参数类型,利达附件类型UF_DRF_leader附加对象=连接对象UF_DRF_leader_attach屏幕=屏幕位置

第5个参数为输入:
object代表参数变量,UF_DRF_object_p_t 为输入参数类型,对象的数据附加领袖(见uf_drf_types.h)有效的对象类型:点,线,弧,二次曲线,三次样条,B曲线,实线。如果leader_attach_type是UF_DRF_leader_attach_screen,则对象= NULL。注:UF_DRF_object_t是由几个功能使用通用结构。输入字段object_assoc_type和object_assoc_modifier不受UF_DRF_create_label支持。例如,贴上领导的圆弧中心不支持,也不是支持交互式创作NX一个标签。

第6个参数为输入:
输入double 双精度类型的参数,参数的变量格式为model_pos_3d [ 3 ],如果leader_attach_type= UF_DRF_leader_attach_object此位置被用作近似点在对象上附加的领导者,如果leader_attach_type= UF_DRF_leader_attach_screen,这一立场是领导者的终点3D模型空间中的位置

第7个参数为输出:
label_tag代表参数变量,tag_t* 为输出参数类型,创建标签的对象标记。

UF_DRF_create_label函数实例代码演示:
此示例创建一个标签。
[quote]
#include <stdio.h>
#include <string.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_curve.h>
void ufusr(char *param, int *retcod, int param_len)
{
int status = 0;
int lines_of_text = 7;
static double origin[3] = {20.0, 0.0, 0.0};
static double base_pt[3] = {20.0, 5.0, 0.0};
char text[10][132+1];
char stat_msg[133];
tag_t base_pt_tag, text_aid_tag;
UF_DRF_object_t object;
status = UF_initialize();
if (!status)
{
/* initialize the object structures */
UF_DRF_init_object_structure(&object);
/* create a base point */
status = UF_CURVE_create_point(base_pt, &base_pt_tag);
}
if (!status)
{
/* create a label */
strcpy(text[0], "This is a LABEL.");
strcpy(text[1], "It points to the screen position at
(20,5).");
strcpy(text[2], "The next line is BLANK.");
strcpy(text[3], "");
strcpy(text[4], "The next line is very long....");
strcpy(text[5], "ABCDEFGHIJKLMNOPQRSTUVWXYZYXWV");
strcpy(text[6], "This is the LAST line.");
object.object_tag = base_pt_tag;
object.object_view_tag = NULL_TAG;
object.object_assoc_type = UF_DRF_end_point;
object.object_assoc_modifier = UF_DRF_first_end_point;
status = UF_DRF_create_label(lines_of_text, text, origin,
UF_DRF_leader_attach_screen, &object, base_pt,
&text_aid_tag);
}
printf("UF_DRF_create_label ");
if (status)
{
UF_get_fail_message(status, stat_msg);
printf("has ERROR %d: %s.\n", status, stat_msg);
}
else
printf("is successful.\n");
UF_terminate();
}



[/quote]

0

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