找回密码 注册 QQ登录
一站式解决方案

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 16749|回复: 0
打印 上一主题 下一主题

[讨论] 焊接代码

[复制链接]
跳转到指定楼层
1
发表于 2009-8-11 10:12:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
下面是我编写的创建焊接标注的程序,但是执行后,只出现点,并未出现焊接标注,大家帮忙看看代码有什么问题,多谢!

/******************************************************************************
             Copyright (c) 1999 Unigraphics Solutions, Inc.
                       Unpublished - All Rights Reserved
*******************************************************************************/
/* This example creates a weld symbol. */
#include <stdio.h>
#include <string.h>
#include "uf.h"
#include "uf_defs.h"
#include "uf_drf.h"
#include "uf_curve.h"
void ufusr(char *param, int *retcod, int param_len)
{
   int status = 0;
   static double  origin[3] = {20.0, 0.0, 0.0};
   static double base_pt[3] = {20.0, 100.0, 0.0};
   //char **text=NULL;
   char *text[2]={NULL,NULL};
   //char text1[133];
   //strcpy(text1, "This is a LABEL.");
   tag_t base_pt_tag;
   tag_p_t weld_symbol_tag=NULL_TAG;
   UF_DRF_weld_symbols_p_t weld_symbol_data=NULL;
   UF_DRF_weld_sym_info_t        sym_info_top;
   UF_DRF_weld_sym_info_t        sym_info_bottom;
   UF_DRF_object_t object;
   char stat_msg[133];
   status = UF_initialize();
   if (!status)
   {
      /* initialize the object structures */
      UF_DRF_init_object_structure(&object);
      /* create a base point */
      status = UF_CURVE_create_point(base_pt, &base_pt_tag);
   }
   if (!status)
   {
      /* Creates the weld symbol */
    //sym_info_top.angle=text1;
   object.object_tag = base_pt_tag;
      object.object_view_tag = NULL_TAG;
      object.object_assoc_type = UF_DRF_end_point;
      object.object_assoc_modifier = UF_DRF_first_end_point;
    strcpy_s(sym_info_top.angle,133,"30");
    sym_info_top.contour_type = UF_DRF_WELD_CONVEX;
    sym_info_top.finish_type = UF_DRF_WELD_CHIP_FINISH;
    strcpy_s(sym_info_top.num_root_depth,133,"8");
    strcpy_s(sym_info_top.pitch,133,"30");
    strcpy_s(sym_info_top.size,133,"20");
    //sym_info_top.pitch = 30;
    //sym_info_top.size = 20;
    sym_info_top.size_code = UF_DRF_WELD_CODE_A;
    sym_info_top.weld_type = UF_DRF_WELD_BUTT_WITH_RE_SYMBOL;
    strcpy_s(sym_info_bottom.angle,133,NULL);
    sym_info_bottom.contour_type = UF_DRF_WELD_NONE;
    sym_info_bottom.finish_type = UF_DRF_WELD_NO_FINISH;
    strcpy_s(sym_info_bottom.num_root_depth,133,NULL);
    strcpy_s(sym_info_bottom.pitch,133,NULL);
    strcpy_s(sym_info_bottom.size,133,NULL);
    sym_info_bottom.size_code = UF_DRF_WELD_NO_CODE;
    sym_info_bottom.weld_type = UF_DRF_WELD_NO_SYMBOL;
        //text[0]=new char[133];
    //text[1]=new char[133];
     strcpy_s(text[0],133,"asdf");
     strcpy_s(text[1],133,"1234");
    weld_symbol_data->center_flag = 1;
    weld_symbol_data->extension = UF_DRF_WELD_SYM_EXT_DOG_LEG;
    weld_symbol_data->field_flag = 1;
    weld_symbol_data->ident_line_type = UF_DRF_WELD_SYM_IDENT_LINE_TOP;
    weld_symbol_data->num_lines = 2;
    weld_symbol_data->peripheral_flag = 1;
    weld_symbol_data->reference_text = text;
    weld_symbol_data->scale_factor = 100;
    weld_symbol_data->staggered_flag = 1;
    weld_symbol_data->sym_info_bottom = sym_info_bottom;
    weld_symbol_data->sym_info_top = sym_info_top;
    strcpy_s(weld_symbol_data->symbol_standard,31,"ISO");
      /*
   int UF_DRF_create_weld_symbol
  (
  double origin_3d [ 3 ] ,
  UF_DRF_leader_type_t leader_type,
  UF_DRF_object_p_t object,
  double model_pos_3d [ 3 ] ,
  UF_DRF_weld_symbols_p_t weld_symbol_data,
  tag_p_t weld_symbol_tag
  )
   */
   status = UF_DRF_create_weld_symbol(
          origin,
          UF_DRF_leader_screen,
          &object,
          base_pt ,
          weld_symbol_data,
          weld_symbol_tag);
   }
   printf("UF_DRF_create_weld_symbol ");
   if (status)
   {
      UF_get_fail_message(status, stat_msg);
      printf("has ERROR %d: %s.\n", status, stat_msg);
   }
   else
      printf("is successful.\n");
   UF_terminate();

}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-12-27 18:55 , Processed in 0.028941 second(s), 12 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表