OPENC函数 UF_ATTR函数(UF_ATTR_read_value 函数用法)

 1 //此函数的功能是输入tag值,返回与属性标题对应的属性值
 2 static string read_attr(tag_t object_tag)
 3 {
 4     UF_initialize();
 5 
 6     char title[UF_ATTR_MAX_TITLE_LEN + 1]="零件名称";
 7     int type= UF_ATTR_any;
 8     UF_ATTR_value_t value;
 9     //读属性值
10     UF_ATTR_read_value(object_tag,title,type,&value);
11     string s1=value.value.string;
12     return s1;
13 
14     UF_terminate();
15 }
16 extern DllExport void ufsta( char *param, int *returnCode, int rlen )
17 {
18     /* Initialize the API environment */
19     if( UF_CALL(UF_initialize()) ) 
20     {
21         /* Failed to initialize */
22         return;
23     }
24     
25     /* TODO: Add your application code here */
26 
27     tag_t object_tag=609790;
28     string s2=read_attr(object_tag);
29     //打印
30     UF_UI_open_listing_window();
31     UF_UI_write_listing_window(s2.c_str());
32 
33     /* Terminate the API environment */
34     UF_CALL(UF_terminate());
35 }

原文地址:https://www.cnblogs.com/zzyfym/p/12038641.html