NX二次开发中,删除一个对象的代码分享
NX二次开发中,删除一个对象的代码分享
仅供参考!!
int deleteObject(NXOpen::NXObject* selectedObject)
{
int error = 0;
try
{
std::vector<NXObject* >obj(1);
obj = selectedObject;
int nErrs = theSession->UpdateManager()->AddToDeleteList(obj);
//Report any errors - normally the error list should be scanned and each error processed
if(nErrs > 0)
{
error = 1;
std::stringstream tmpString;
tmpString << "nErrs =" << nErrs;
SelectionExample::theUI->NXMessageBox()->Show("Add To Delete Errors", NXOpen::NXMessageBox::DialogTypeError, tmpString.str() );
}
}
catch(exception& ex)
{
throw;
}
return error;
}
页:
[1]