NX二次开发 NXOpen不用UI控件,鼠标选中对象获得tag theUI->SelectionManager()->GetSelectedObject(i)
NX8.0+VS2010
#include <uf_defs.h>
#include <NXOpen/NXException.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/ListingWindow.hxx>
#include <NXOpen/NXMessageBox.hxx>
#include <NXOpen/NXObject.hxx>
using namespace NXOpen;
Session *theSession = Session::GetSession();
Part *workPart(theSession->Parts()->Work());
Part *displayPart(theSession->Parts()->Display());
UI *theUI = UI::GetUI();
//返回当前选择的对象的数量
int index = theUI->SelectionManager()->GetNumSelectedObjects();
theSession->ListingWindow()->