iCAx开思网

标题: 怎么样在自己开发的程序中实现和UG的选择功能?求教 [打印本页]

作者: zhanghxing    时间: 2004-7-24 11:01
标题: 怎么样在自己开发的程序中实现和UG的选择功能?求教
好像实现与图形交互,也不是一件很容易的事情,我尝试了不少方法,研究了例程,好像都不成?
不知道该怎么处理。正在着急呢?
能不能详细的介绍一下UF_UI_select_class_dialog()函数的使用方法?
作者: tari    时间: 2004-7-26 11:04
兄弟,这样问问题很少人回答的
你最好还是问问你在使用这个函数碰到什么问题,大家好帮你解决
作者: wflying    时间: 2004-7-26 11:21
交互选择的函数在UF_UI.h中,具体怎么用自己看看说明!
作者: suye007    时间: 2004-7-26 18:55
应该是这个函数吧UF_UI_select_with_class_dialog( )?
help里面有example 的啊
作者: huashanyjj    时间: 2004-8-3 15:26
/******************************************************************************
             Copyright (c) 1999 Unigraphics Solutions, Inc.
                       Unpublished - All Rights Reserved
  
*******************************************************************************/
/*
This example shows using the class selection dialog with all standard
object types selectable. To set different object types selectable, see the
example for UF_UI_select_with_single_dialog.
*/
  
#include <stdio.h>
#include <uf.h>
#include <uf_ui.h>
#include <uf_disp.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
static int report( char *file, int line, char *call, int irc)
{
  if (irc)
  {
     char    messg[133];
     printf("%s, line %d:  %s\n", file, line, call);
     (UF_get_fail_message(irc, messg)) ?
       printf("    returned a %d\n", irc) :
       printf("    returned error %d:  %s\n", irc, messg);
  }
  return(irc);
}
static void do_ugopen_api(void)
{
    char cue[] = "Select Objects";
    char title[] = "User Title";
    int response, count, i;
    tag_p_t objects;
    /* Use multiple class selection with scope set to any object
       in the work part and without using an initialization
procedure.
    */
    if((UF_CALL(UF_UI_select_with_class_dialog(
          cue, title, UF_UI_SEL_SCOPE_WORK_PART,
          NULL, NULL, &response, &count, &objects))) == 0)
    {
         printf("object count = %d\n",count);
         if (response == UF_UI_OK && count > 0)
         {
             for (i=0; i<count; i++)
             {
                 printf("object tag = %d\n", objects);
                 UF_DISP_set_highlight(objects, 0);
             }
             UF_free(objects);
         }
    }
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int param_len)
{
  if (!UF_CALL(UF_initialize()))
  {
    do_ugopen_api();
    UF_CALL(UF_terminate());
  }
}
int ufusr_ask_unload(void)
{
  return (UF_UNLOAD_IMMEDIATELY);
}




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3