MStatus status = MGlobal::executeCommand("polySphere"); if (status != MS::kSuccess) { MStatus::perror("Failed to create polySphere"); }
MFnDagNode node; MStatus status = node.setObject(MObject::kNullObj); if (status != MS::kSuccess) { MStatus::perror("Failed to set object"); }This example sets the DAG node object to NULL using MFnDagNode. If the operation fails, the error message "Failed to set object" is printed to the console using MStatus perror. The MStatus perror function is part of the Maya API library that is distributed with the Autodesk Maya software.