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");
NX二次开发-NXOpen窗口打印NXMessageBox&ListingWindow