Message 1 of 8

Not applicable
06-28-2020
01:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm tring to use both c++ and python api to execute maxscript command -- maxversion().According to maxscript help document,the return should be an Array with three integers.In python script,i get #(21000, 52, 0),that's actually what i need.But when it comes to c++ api,i get a int table,which has a lot of items.This is obviously not correct.So i think there is something wrong in my code.
My python code:
import MaxPlus
localMaxVerValue = MaxPlus.FPValue()
MaxPlus.Core.EvalMAXScript('maxversion()', localMaxVerValue)
localMaxVer = localMaxVerValue.Get().GetItem(0)
My c++ code:
FPValue retValue = FPValue();
int version;
if (!ExecuteMAXScriptScript(LPCWSTR("maxversion()"), FALSE, &retValue)) {
return ret;
}
if (retValue.type != TYPE_VALUE) {
return ret;
}
else {
Tab<INT_PTR>* result = retValue.i64_tab;
int number = result->Count();
INT_PTR* versionPtr = result->Addr(0);
version = *versionPtr;
}
localMaxVer is correct,the value is 21000.version is incorrect,the value is 526772528.number is incorrect too,it's too huge,the value is 525918705,i think it should be 3.
Can somebody help me find where is wrong,thank you!
Solved! Go to Solution.