hcaini0829 发表于 2015-7-17 17:46:30

2015.7.12_Lession2创建圆柱体并得到中心线的起点终点的信息

double origin={50,100,200};
double dir={1,1,1};
double pointCoords1;
double pointCoords2;

tag_t partTag=NULL_TAG;
tag_t cylTag=NULL_TAG;
tag_t lineTag=NULL_TAG;
tag_t sopointTag=NULL_TAG;

int errorCode=0;
int res=0;

UF_CURVE_line_t line_coords;
UF_CURVE_line_t line_coords1;
UF_UI_POINT_base_method_t base_method = UF_UI_POINT_CENTER_PT;
UF_system_info_t time;

char msg;

errorCode=UF_PART_new("D;\\ug\\myhomework.prt",1,&partTag);//创建myhomework部件;
        if (errorCode)//判断部件是否已经存在;
        {
                uc1601("The Part already existed",1);
        }
        UF_CALL(UF_MODL_create_cyl1(UF_NULLSIGN,origin,"300","100",dir,&cylTag));//创建圆柱体;
        UF_UI_point_construct("Please select one point",&base_method,&sopointTag,pointCoords1,&res);//利用点构造器选取中心线起点
        line_coords.start_point=pointCoords1;
        line_coords.start_point=pointCoords1;
        line_coords.start_point=pointCoords1;
        UF_UI_point_construct("Please select one point",&base_method,&sopointTag,pointCoords2,&res);//选取中心线终点
        line_coords.end_point=pointCoords2;
        line_coords.end_point=pointCoords2;
        line_coords.end_point=pointCoords2;
        UF_CURVE_create_line(&line_coords,&lineTag);//创建中心线
        UF_CURVE_ask_line_data(lineTag,&line_coords1);//访问中心线信息
        UF_ask_system_info(&time);//访问系统时间
       
        sprintf(msg,"start point:x=%f,y=%f,z=%f\nend point:x=%f,y=%f,z=%f\nAuthor;Honey\nTime:",
                pointCoords1,pointCoords1,pointCoords1,pointCoords2,pointCoords2,pointCoords2);
       
        UF_UI_open_listing_window();
        UF_UI_write_listing_window(msg);
        UF_UI_open_listing_window();
        UF_UI_write_listing_window(time.date_buf);
        UF_PART_save();


秋爱 发表于 2015-7-17 20:00:24

好工整啊{:2_30:}
页: [1]
查看完整版本: 2015.7.12_Lession2创建圆柱体并得到中心线的起点终点的信息