1 NX11+VS2013 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 #include <uf_ui.h> 6 7 8 UF_initialize(); 9 10 //创建球 11 UF_FEATURE_SIGN Sign = UF_NULLSIGN;//设置布尔 12 double Center[3] = { 0.0, 0.0, 0.0 };//原点 13 char *Diam = "100";//直径 14 tag_t SphereTag = NULL_TAG; 15 UF_MODL_create_sphere1(Sign, Center, Diam, &SphereTag); 16 17 //获取球的参数 18 char *Diameter;//输出直径 19 UF_MODL_ask_sphere_parms(SphereTag, 1, &Diameter); 20 21 22 //打印 23 uc1601(Diameter, 1);//默认输出格式为表达式等号左右值 24 25 26 //只输出表达式等号右值 27 //提取左右值 28 string Dia = Diameter; 29 string Strleft = (Dia.substr(0, Dia.find("=")));//提取左值 30 string Strright = (Dia.substr(Dia.find("=") + 1, Dia.find(" ")));//提取右值 31 32 char BufLeft[256], BufRight[256];//左值,右值 33 //将string类型转换为字符数组 34 strcpy(BufLeft, Strleft.c_str()); 35 strcpy(BufRight, Strright.c_str()); 36 37 //打印右值 38 uc1601(BufRight, 1); 39 40 //释放内存 41 UF_free(Diameter); 42 43 UF_terminate();