1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 #include <uf_ui.h> 6 7 UF_initialize(); 8 9 //创建点1 10 double PointCoords1[3] = {125.5, 263.2, 135.2}; 11 tag_t Point1Tag = NULL_TAG; 12 UF_CURVE_create_point(PointCoords1, &Point1Tag); 13 14 //创建点2 15 double PointCoords2[3] = {65.5, 95.6, 78.6}; 16 tag_t Point2Tag = NULL_TAG; 17 UF_CURVE_create_point(PointCoords2, &Point2Tag); 18 19 //求两个对象的最短距离 20 double Guess1[3]; 21 double Guess2[3]; 22 double MinDist; 23 double PtOnObj1[3]; 24 double PtOnObj2[3]; 25 UF_MODL_ask_minimum_dist(Point1Tag, Point2Tag, 0, Guess1, 0, Guess2, &MinDist, PtOnObj1, PtOnObj2); 26 27 //打印 28 char msg[256]; 29 sprintf(msg, "%f", MinDist); 30 UF_UI_open_listing_window(); 31 UF_UI_write_listing_window(msg); 32 33 UF_terminate();