Calling MAXScript from C++
 
 
 

The global function ExecuteMAXScriptScript() can be used to execute MAXScript from C++. This function has the following signature:

BOOLExecuteMAXScriptScript(MCHAR *s, BOOL quietErrors = FALSE, FPValue *fpv = NULL);

If the string is successfully compiled and executed by the MAXScript script engine, and a pointer to an FPValue is provided, any value returned from the script is converted to an FPValue and returned through the fpv parameter.

If the string is not successfully compiled and evaluated, error messages are written to the MAXScript listener or logged using LogSys. If net rendering, or the quietError argument is TRUE, error messages with only be logged using LogSys.

This function returns TRUE if the script was compiled and executed successfully.