JIN519820XX 发表于 2015-4-18 15:26:04

第二节课作业

tag_t part_tag=NULL_TAG;
double originPoint={0.0,0.0,0.0};
char* cyHeight="200";
char* cyDiam="60";
double cyDirection={0.0,0.0,1.0};
tag_t cy_tag=NULL_TAG;

UF_CURVE_line_t lineCoords;
tag_t lineTage=NULL_TAG;
double endPoint={0.0,0.0,200.0};

charmsg;
double lineStartPoint;
double lineEndPoint;

extern DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
/* Initialize the API environment */
    if( UF_CALL(UF_initialize()) )
    {

      /* Failed to initialize */
         return;
    }

   /* TODO: Add your application code here */
      UF_PART_new("D:\plmpart.prt",1,&part_tag);
   UF_MODL_create_cyl1(UF_NULLSIGN,originPoint,cyHeight,cyDiam,cyDirection,&cy_tag);
   lineCoords.start_point=originPoint;
   lineCoords.start_point=originPoint;
   lineCoords.start_point=originPoint;

    lineCoords.end_point=endPoint;
    lineCoords.end_point=endPoint;
    lineCoords.end_point=endPoint;
    UF_CURVE_create_line(&lineCoords,&lineTage);
    UF_CURVE_ask_line_data(lineTage,&lineCoords);
    lineStartPoint=lineCoords.start_point;
   lineStartPoint=lineCoords.start_point;
   lineStartPoint=lineCoords.start_point;
   lineEndPoint=lineCoords.end_point;
   lineEndPoint=lineCoords.end_point;
   lineEndPoint=lineCoords.end_point;
   sprintf(msg,"起始点:X:%f,Y:%f,Z:%f",lineStartPoint,lineStartPoint,lineStartPoint);
   uc1601(msg,1);
   sprintf(msg,"终点:X:%f,Y:%f,Z:%f",endPoint,endPoint,endPoint);
   uc1601(msg,1);
   UF_PART_save();
   UF_PART_close_all();
    /* Terminate the API environment */
UF_CALL(UF_terminate());
}



admin 发表于 2015-4-18 21:23:44

很不错 !
页: [1]
查看完整版本: 第二节课作业