[c++] uf平行尺寸

[复制链接]
梅雷工具箱发表于 2015-6-25 14:17:09 | 显示全部楼层 |阅读模式

uf平行尺寸

#include <stdio.h>
#include <uf_defs.h>
#include <uf_drf.h>
#include <uf_curve.h>



/* TODO: Add your application code here */

//平行尺寸
int status = 0;
   static double  point[3] = {80.0, 40.0, 0.0};
   static double origin[3] = {50.0, 90.0, 0.0};
   static char dimtxt[15+1] = "PARALLEL DIM TX";
   static char apptxt[3][132+1] = {"APPENDED TEXT",
                                   "APP TXT LINE 2",
                                   "APP TXT LINE 3"};

   tag_t point_tag, line_tag, dimension_tag;
   UF_CURVE_line_t line_coords;
   UF_DRF_object_t object1, object2;
   UF_DRF_text_t   drf_text;
   status = UF_initialize();
   if (!status)
   {
      /* initialize the object structures */
      UF_DRF_init_object_structure(&object1);
      UF_DRF_init_object_structure(&object2);
      /* load drf_text specification */
      drf_text.user_dim_text  = dimtxt;
      drf_text.lines_app_text = 3;
      drf_text.appended_text  = apptxt;
      /* create a point */
      status = UF_CURVE_create_point(point, &point_tag);
   }
   if (!status)
   {
      /* create a line */
      line_coords.start_point[0] = 10.0;
      line_coords.start_point[1] = 20.0;
      line_coords.start_point[2] = 0.0;
      line_coords.end_point[0] = 20.0;
      line_coords.end_point[1] = 20.0;
      line_coords.end_point[2] = 0.0;
      status = UF_CURVE_create_line(&line_coords, &line_tag);
   }
   if (!status)
   {
      /* create a parallel dimension */
      object1.object_tag = line_tag;
      object1.object_view_tag = NULL_TAG;
      object1.object_assoc_type = UF_DRF_end_point;
      object1.object_assoc_modifier = UF_DRF_last_end_point;
      object2.object_tag = point_tag;
      object2.object_view_tag = NULL_TAG;
      object2.object_assoc_type = UF_DRF_end_point;
      object2.object_assoc_modifier = UF_DRF_first_end_point;
      status = UF_DRF_create_parallel_dim(&object1, &object2,
               &drf_text, origin, &dimension_tag);
   }

   if (status)
   {
              char  stat_msg[133];
      UF_get_fail_message(status, stat_msg);
      uc1601(stat_msg,1);
   }
  
      





        /* Terminate the API environment */

_____________________________________________________________________________ _

中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/
就上UG网淘宝直营店
您需要登录后才可以回帖 登录 | 注册UG网 用百度帐号登录

本版积分规则