run file MaxScript (.ms) ?

 
 
 
Posted by:kkcczz
Data created:24 March 2011

How to run a MaxScript file in MAX.NET?

Thanks

Hi,

You have to use:

ExecuteMAXScriptScript method inside IGlobal, and pass in the contents of your mxs file as a string. You can do that easily by using standard .NET method:

File.ReadAllText (path);

 

 

 

Cheers,

Light

 

thank ^^

I use global.ExecuteSript:

 

string s = System.IO.File.ReadAllText("C:\\abc.ms");
                        global.ExecuteScript(global.StringStream.Create(s), false);

string s = System.IO.File.ReadAllText("C:\\abc.ms");

global.ExecuteScript(global.StringStream.Create(s), false);

 

but i can't use method  global.ExecuteMAXScriptScript(string s,bool quietErrors, IFPValue fpv)

i don't know what is IFPValue  and boolquietErrors = true or false...

 

I haven't used ExecuteMAXScriptScript much but I believe the fpv is supposed to be a pointer to values passed as parameters into script? Maybe not, but you should be able to pass null to it. Quiet errors just means that errors won't be printed to the listener.


I would probably just read in the script file and use ExecuteScript function.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Sorry for the late reply, but fpv is the return value (function publishing value), which is converted to an fpv value by ExecuteMAXScriptScript. If you look at FPValue, you will see all sorts of methods for conversions to other value types.

 

 

Light