点击查看详细介绍

[NXOpen C++] UG二次开发,通过selectTaggedObject,选择一个UG对象并输出tag标签

王牌飞行员 VIP会员 6年前 4767 37

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


说明:通过SelectTaggedObject,选择一个UG对象并输出tag标签

测试代码:

//通过SelectTaggedObject选择对象并输出tag标签
#if ! defined ( __hp9000s800 ) && ! defined ( __sgi ) && ! defined ( __sun )
#   include <strstream>
#   include <iostream>
    using std::ostrstream;
    using std::endl;    
    using std::ends;
    using std::cerr;
#else
#   include <strstream.h>
#   include <iostream.h>
#endif
#include <uf.h>
#include <uf_ui.h>
#include <uf_exit.h>
#include <uf_defs.h>
#include <NXOpen/NXException.hxx>
#include <NXOpen/ModelingView.hxx>
#include <NXOpen/ModelingViewCollection.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <uf_ui.h>
#include <uf_ui_ugopen.h>
#include <uf.h>
#include <NXOpen/Session.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/selection.hxx>
#include <NXOpen/Features_Feature.hxx>
#include <NXOpen/ListingWindow.hxx>
using namespace NXOpen;
using namespace std;
 
#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);
 
        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);
}

●●●请先 登陆注册 后查看●●●

效果演示:

1

最新回复 (37)
  • 不及无耐 VIP会员 6年前
    1

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • zujiedage 6年前
    2

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • zhang1991 VIP会员 6年前
    3

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • q574944402 6年前
    4

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • 鸿蒙之始 6年前
    5

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • googoe001 6年前
    6

    楼主楼主你最棒,你是天下第一棒!

  • Elena 6年前
    7

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • ruilinhua 6年前
    8

    感谢楼主分享!!!

  • licxsw 6年前
    9

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • xudongsong 6年前
    10

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • 模具 VIP会员 6年前
    11

    多谢楼主学习!多谢楼主学习!

  • 晋辉 VIP会员 5年前
    12

    多谢楼主学习!多谢楼主学习!

  • hu1576612022 VIP会员 5年前
    13

    感谢楼主分享,多谢楼主学习!楼主最棒!

  • xhm225 5年前
    14

    感谢!!!!!!!!!

  • chendong_888 5年前
    15

    感谢楼主分享,多谢楼主学习!楼主最棒!

请登录后发表新帖