uf引线文本
#include <stdio.h>
#include <string.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_curve.h>
/* TODO: Add your application code here */
int status = 0;
int lines_of_text = 2;//文本行数
static double origin[3] = {110, 40, 0};
static double base_pt[3] = {20,20, 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)
{
/* 初始化对象的结构 */
UF_DRF_init_object_structure(&object);
/* 创建点 */
status = UF_CURVE_create_point(base_pt, &base_pt_tag);
}
if (!status)
{
/* 创建一个引线尺寸 */
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.");
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);
}
if (status)
{
UF_get_fail_message(status, stat_msg);
uc1601(stat_msg,1);
}
else
uc1601("创建已经创建",1);
/* Terminate the API environment */
_____________________________________________________________________________ _
中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/ |