NX9+VS2012
#include <NXOpen/NXObject.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/NXMessageBox.hxx>
#include <NXOpen/ListingWindow.hxx>
using namespace NXOpen;
NXMessageBox *mb;
ListingWindow *lw;
NXOpen::Session *theSession = NXOpen::Session::GetSession();
NXOpen::Part *workPart(theSession->Parts()->Work());
NXOpen::Part *displayPart(theSession->Parts()->Display());
UI *theUI = UI::GetUI();
mb = theUI->NXMessageBox();
lw = theSession->ListingWindow();
//方法1(NXMessageBox)
mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeError, "HelloWorld");//类型1
mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeWarning, "HelloWorld");//类型2
mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeInformation, "HelloWorld");//类型3
mb->Show("HelloTitle", NXOpen::NXMessageBox::DialogTypeQuestion, "HelloWorld");//类型4
//方法2(ListingWindow)
lw->Open();
lw->WriteLine("HelloWorld");
Caesar卢尚宇 [email protected]