购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_DRF_ask_obj_text_above_ldr( tag_t object, UF_DRF_text_above_leader_t * option) 函数说明:
返回上面领袖属性的文本标签或维度。如果返回UF_DRF_NO_TEXT_ABOVE_LEADER的值,该文本是领导存根上面不显示。领导存根的位置相对于文本由垂直文本对齐控制。这可以用UF_DRF_ask_object_preferences进行查询。
函数参数:
第1个参数为输入:
object代表参数变量,tag_t 为输入参数类型,标签或尺寸的标签
第2个参数为输出:
option代表参数变量,UF_DRF_text_above_leader_t * 为输出参数类型,上面的文字属性的领导者为指定的标签或维度
UF_DRF_ask_obj_text_above_ldr函数实例代码演示:
在下面的示例代码设置上面领导的属性文本并创建一个标签,这将有下面显示的领导者存根文字的底线,文本的其他行会被强调,而领导存根和下划线都将被扩展到最大标签的文本长度。一部分必须激活。
[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)
{
double origin[3] = {10.0, 0.0, 0.0};
double base_pt[3] = {5.0, 5.0; 0.0};
char text[10][132+1];
char stat_msg[133];
int status;
int lines_of_text = 7
tag_t base_pt_tag, text_aid_tag;
UF_DRF_object_t object;
UF_DRF_text_above_leader_t text_above_leader;
UF_DRF_text_above_leader_t save_text_above_leader;
status = UF_initialize();
if (!status)
{
/* initialize the object structure */
UF_DRF_init_object_structure(&object);
/* create a base point */
status = UF_CURVE_create_point(base_pt, &base_pt_tag);
}
if (!status)
{
/* save the current global preference */;
status =
UF_DRF_ask_text_above_leader(&save_text_above_leader);
/* set the global preference to display the leader stub
below the bottom line of the text, underline the other text
lines, and extend the stub and underlines to the maximum
text length */
status = UF_DRF_set_text_above_leader(
UF_DRF_LEADER_BOTTOM_TEXT_MAX_UNDERLINE);
}
/* create a label */
if (!status)
{
strcpy(text[0], "This is a LABEL");
strcpy(text[1], "It points to the point at (5,5)");
strcpy(text[2], "The next line is blank");
strcpy(text[3], "");
strcpy(text[4], "The next line is very long");
strcpy(text[5], "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789");
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_object, &object, base_pt,
&text_aid_tag);
}
/* inquire the text above leader attribute for the label */
if (!status)
{
status = UF_DRF_ask_obj_text_above_ldr(text_aid_tag,
&text_above_leader);
}
/* restore the saved value for text above leader */
if (!status)
status =
UF_DRF_set_text_above_leader(save_text_above_leader);
printf("UF_DRF_create_label, UF_DRF_set_text_above_leader ");
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]