Max-Saed-Hulk
04-22-2009, 01:51 AM
Hi people .. i have a Q
is there a way to execute a Python Command inside C++ some one told me that i can use the executePythonCommand from MGlobal.h i saw it in the API document in maya2009 but it says under it "This method is not available in Python" is that mean that its not working ?
can i run that in this code sample ? and wut changes i should add to it for it to work .. thank you.
#include <maya/MSimple.h>
#include <maya/MIOStream.h>
#include <maya/MGlobal.h>
#include <maya/MLibrary.h>
DeclareSimpleCommand( saed, "Autodesk", "2009");
MStatus saed::doIt( const MArgList& args )
{
cout << "Hello "<< endl;// in the output window
int saed = 2;
int saed2 = 3;
cout<<saed+saed2<<endl;// in the output window
MGlobal::displayInfo("King nothing");// in the script editor
MGlobal::executePythonCommand("print 66",true);// not working
MGlobal::executeCommand( "print \"Hello world!\\n\"", true );// using mel
return MS::kSuccess;
}
is there a way to execute a Python Command inside C++ some one told me that i can use the executePythonCommand from MGlobal.h i saw it in the API document in maya2009 but it says under it "This method is not available in Python" is that mean that its not working ?
can i run that in this code sample ? and wut changes i should add to it for it to work .. thank you.
#include <maya/MSimple.h>
#include <maya/MIOStream.h>
#include <maya/MGlobal.h>
#include <maya/MLibrary.h>
DeclareSimpleCommand( saed, "Autodesk", "2009");
MStatus saed::doIt( const MArgList& args )
{
cout << "Hello "<< endl;// in the output window
int saed = 2;
int saed2 = 3;
cout<<saed+saed2<<endl;// in the output window
MGlobal::displayInfo("King nothing");// in the script editor
MGlobal::executePythonCommand("print 66",true);// not working
MGlobal::executeCommand( "print \"Hello world!\\n\"", true );// using mel
return MS::kSuccess;
}
