1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_obj.h> 5 #include <uf_ui.h> 6 7 8 UF_initialize(); 9 10 //遍历名字找到直线 11 tag_t LineTag = NULL_TAG; 12 UF_OBJ_cycle_by_name("MAIN", &LineTag); 13 14 //获取直线的两个端点 15 UF_CURVE_line_t LineCoords; 16 UF_CURVE_ask_line_data(LineTag, &LineCoords); 17 18 //打印 19 char msg[256]; 20 sprintf_s(msg, "起点:X:%f,Y:%f,Z:%f 终点:X:%fY:%fZ:%f",LineCoords.start_point[0],LineCoords.start_point[1],LineCoords.start_point[2], 21 LineCoords.end_point[0],LineCoords.end_point[1],LineCoords.end_point[2]); 22 UF_UI_open_listing_window(); 23 UF_UI_write_listing_window(msg); 24 25 UF_terminate();