zoukankan      html  css  js  c++  java
  • NX二次开发-NXOpen窗口打印NXMessageBox&ListingWindow

     1     NX9+VS2012
     2     
     3     #include <NXOpen/NXObject.hxx>
     4     #include <NXOpen/Part.hxx>
     5     #include <NXOpen/PartCollection.hxx>
     6     #include <NXOpen/UI.hxx>
     7     #include <NXOpen/NXMessageBox.hxx>
     8     #include <NXOpen/ListingWindow.hxx>
     9     
    10     using namespace NXOpen;
    11 
    12 
    13     NXMessageBox *mb;
    14     ListingWindow *lw;
    15 
    16     NXOpen::Session *theSession = NXOpen::Session::GetSession();
    17     NXOpen::Part *workPart(theSession->Parts()->Work());
    18     NXOpen::Part *displayPart(theSession->Parts()->Display());    
    19     UI *theUI = UI::GetUI();
    20 
    21     mb = theUI->NXMessageBox();
    22     lw = theSession->ListingWindow();
    23 
    24     //方法1(NXMessageBox)
    25     mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeError, "HelloWorld");//类型1
    26     mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeWarning, "HelloWorld");//类型2
    27     mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeInformation, "HelloWorld");//类型3
    28     mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeQuestion, "HelloWorld");//类型4
    29 
    30 
    31     //方法2(ListingWindow)
    32     lw->Open();
    33     lw->WriteLine("HelloWorld");

  • 相关阅读:
    团队冲刺六
    团队冲刺五
    【Mybaits学习】03_ CRUD基于注解
    【Mybaits学习】02_ 快速入门
    【Mybaits学习】01_ 初识
    深圳国际马拉松
    深圳南山半程马拉松
    Selenide使用笔记
    UI自动化测试01-环境搭建
    Java C3p0在Spring中运用
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/10957463.html
Copyright © 2011-2022 走看看