Warning: file(datafile/online) [function.file]: failed to open stream: No such file or directory in /home/all2one/public_html/bbs/topic.php on line 200
阳光精品论坛 > 『 CAD 专栏 』 > UF_PARAM_set_int_value的用法
 
欢迎您,客人:高级登录 | 注册 | 取回密码 新贴 | 发帖 | 会员 | 搜索 | 帮助

阳光精品论坛 >> 『 CAD 专栏 』 >> UF_PARAM_set_int_value的用法本主题已阅读2934次,回复0
发表一个新主题 回复贴子
批量引用回复把本贴加入论坛收藏夹向管理员报告帖子问题
作者 | 本页主题: UF_PARAM_set_int_value的用法 上一个主题:proE中将装配体的一半给隐藏掉 下一个主题:随心所欲定制自己的UG启动界面  
even2004 

 
 究级天王 [荣誉]
信息:坛主标志 该用户目前离线
来自:未填 align=absmiddle
发贴:1239 贴 查找所有我发的帖子
积分:244
货币:5814 阳光币
注册时间:2008/12/31
 查看会员个人资料资料 将其加入好友列表好友 发短信息消息 引用回复这个贴子引用直接回复贴子回复

UF_PARAM_set_int_value的用法
此帖于 2009/06/06/07:55 被 even2004 编辑


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <uf.h>
#include <uf_ui.h>
#include <uf_disp.h>
#include <uf_object_types.h>
#include <uf_obj.h>
#include <uf_modl.h>
#include <uf_curve.h>
#include <uf_assem.h>

#include <uf_ui_ont.h>
#include <uf_ui_param.h>
#include <uf_oper.h>
#include <uf_cam.h>
#include <uf_cam_errors.h>

#include <uf_param.h>
#include <uf_param_indices.h>



#define UF_CALL(X) (report_error( __FILE__, __LINE__, #X, (X)))

static int report_error( char *file, int line, char *call, int irc)
{
   if (irc)
   {
       char err[133],
            msg[133];

       sprintf(msg, "*** ERROR code %d at line %d in %s:n+++ ",
           irc, line, file);
       UF_get_fail_message(irc, err);
'
   /*  NOTE:  UF_print_syslog is new in V18 */

       UF_print_syslog(msg, FALSE);
       UF_print_syslog(err, FALSE);
       UF_print_syslog("n", FALSE);
       UF_print_syslog(call, FALSE);
       UF_print_syslog(";n", FALSE);

       if (!UF_UI_open_listing_window())
       {
           UF_UI_write_listing_window(msg);
           UF_UI_write_listing_window(err);
           UF_UI_write_listing_window("n");
           UF_UI_write_listing_window(call);
           UF_UI_write_listing_window(";n");
       }
   }

   return(irc);
}



#define WRITE_S(X) (write_string_to_listing_window(X))


void write_string_to_listing_window( char *string)
{
   char
       msg[MAX_LINE_SIZE+1];

   UF_CALL(UF_UI_open_listing_window());
   sprintf(msg, "%sn", string);
   UF_CALL(UF_UI_write_listing_window(msg));
}

static logical specify_point(char *prompt, double loc[3])
{
   int
       ia2[2] = { 0,0 },
       ip3 = 0,
       irc;

   irc = uc1616(prompt, ia2, ip3, loc);
   if (irc == 5) return TRUE;
   else return FALSE;
}


static void do_it(void)-
{/
 
   tag_t        *objects;
       tag_t        point;

   int       i,
             entity_count,)
             object_count, err_code, type, subtype,response,
                 TRIM_POINT1_TOG_AUTOMATIC = 0,
                 TRIM_POINT1_TOG_VECTOR = 1,
                 TRIM_POINT1_TOG_ANGLE = 2,
                 togle_off = 0,
                 togle_on = 1;

       double ang_val_radians = 1.57; // 90 degress

       double pos[3];

   char        msg[MAX_LINE_SIZE+1];
       char errorstrg[133];


logical  is_initialized;
logical is_generated;


if (UF_CALL(UF_CAM_is_session_initialized(&is_initialized)) || (is_initialized == FALSE))return;    


    while (specify_point("Indicate point location", pos))
       UF_CALL(UF_CURVE_create_point(pos, &point));

       /* Get the highlighted/selected objects from Navigation Tool. */
       UF_UI_ONT_ask_selected_nodes( &object_count, &objects );

       if (object_count > 0)
       {
         UF_CALL( UF_OBJ_ask_type_and_subtype (objects[0],&type,&subtype));

         sprintf(msg,"type is %d subtype is %d",type,subtype);
         WRITE_S(msg);

         if (type == UF_machining_operation_type && subtype == UF_mach_turn_rough_subtype )
          {
                       UF_CALL(UF_PARAM_set_int_value(objects[0],UF_PARAM_TURN_TRIM_POINT1_TOG,togle_on));
                       UF_CALL(UF_PARAM_set_tag_value(objects[0],UF_PARAM_TURN_TRIM_POINT1_TAG,point));



                       UF_CALL(UF_PARAM_set_int_value(objects[0],UF_PARAM_TURN_TRIM_POINT1_ANGLE_TOG,TRIM_POINT1_TOG_ANGLE));
                       UF_CALL(UF_PARAM_set_double_value(objects[0],UF_PARAM_TURN_TRIM_POINT1_ANGLE_VAL,ang_val_radians));
                       UF_CALL(UF_PARAM_generate(objects[0],&is_generated));
      }
          else
          {
            sprintf(msg,"object type is not UF_machining_operation_type and subtype is not UF_mach_turn_rough_subtype");
                WRITE_S(msg);
           }
          UF_free(objects);
       }
       else
       {
               UF_CALL(UF_UI_open_listing_window( ));
               sprintf(msg,"objects selected in ONT is not equal to 1");
               UF_CALL(UF_UI_write_listing_window(msg));
       }

   return;
}

extern DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
   /* Initialize the API environment */
   if( UF_CALL(UF_initialize()) )
   {
       /* Failed to initialize */
       return;
   }
 
   do_it();

   /* Terminate the API environment */
   UF_CALL(UF_terminate());
}


extern int ufusr_ask_unload( void )
{
   return( UF_UNLOAD_IMMEDIATELY );


修改贴子编辑 |  发表于 2009/06/06/07:54  |  1 层 

发表一个新主题 回复贴子 推荐给朋友 可打印版本 文章模式 
论坛跳转:


  快速回复  

文章内容:

HTML 代码不可用


BMB代码选项:
[img] - 开启
[flash] - 开启
[size] - 开启

上传附件[还可传0个]:
开启

最大字节: 200000 字节
最少发帖: 20 篇

标题:


  [使用 Ctrl+Enter 直接提交贴子]

你的用户名  你的密码: 忘了密码?

阳光精品论坛 >> 『 CAD 专栏 』 >> UF_PARAM_set_int_value的用法本主题已阅读2934次,回复0



本论坛言论纯属发表者个人意见,与 阳光精品论坛 立场无关 联系我们
Powered by BMForum v5.0 Skin by Bob Shen