快捷导航 上传作品

[c++] uf 直径尺寸

[复制链接]
梅雷工具箱发表于 2015-6-25 14:14:23 | 显示全部楼层 |阅读模式
uf直径尺寸

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


/* TODO: Add your application code here */

//直径尺寸

        int status = 0;
   static double origin[3] = {14.0, 17.0, 0.0};
   static char dimtxt[15+1] = "DIAMETER DIM TX";
   static char apptxt[3][132+1] = {"APPENDED TEXT",
                                   "APP TXT LINE 2",
                                   "APP TXT LINE 3"};
   char  stat_msg[133];
   tag_t wcs, arc_tag, dimension_tag;
   UF_CURVE_arc_t  arc_coords;
   UF_DRF_object_t arc;
   UF_DRF_text_t   drf_text;
   status = UF_initialize();
   if (!status)
   {
      /* initialize the object structure */
      UF_DRF_init_object_structure(&arc);
      /* load drf_text specification */
      drf_text.user_dim_text  = dimtxt;
      drf_text.lines_app_text = 3;
      drf_text.appended_text  = apptxt;
      /* create an arc */
      UF_CSYS_ask_wcs(&wcs);
      UF_CSYS_ask_matrix_of_object(wcs, &arc_coords.matrix_tag);
      arc_coords.start_angle = 0.0;
      arc_coords.end_angle = TWOPI;
      arc_coords.arc_center[0] = 15.0;
      arc_coords.arc_center[1] = 15.0;
      arc_coords.arc_center[2] =  0.0;
      arc_coords.radius = 1.0;
      status = UF_CURVE_create_arc(&arc_coords, &arc_tag);
   }
   if (!status)
   {
      /* create a diameter dimension */
      arc.object_tag = arc_tag;
      arc.object_view_tag = NULL_TAG;
      arc.object_assoc_type = UF_DRF_arc_center;
      arc.object_assoc_modifier = 0;
      status = UF_DRF_create_diameter_dim(&arc, &drf_text,
               origin, &dimension_tag);
   }

   if (status)
   {
      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网

本版积分规则