sim.callScriptFunction via zeroMQ
Posted: 10 Sep 2024, 07:26
I have a problem passing arguments to sim.callScriptFunction in my c++ application via zeroMQ. I'm working with the RemoteApiCLient and jsoncons library.
When i build a json array with jsoncons and pass it to the respective function this function will receive just the first element of the array
C++ Code
CoppeliaSim Script_GUI
Print output:
When i build a json array with jsoncons and pass it to the respective function this function will receive just the first element of the array
C++ Code
Code: Select all
if ( !m_pSimClient )
return false;
auto sim = m_pSimClient->getObject().sim();
json argsRet( json_array_arg );
json args( json_array_arg );
args.push_back("1");
args.push_back("2");
args.push_back("3");
int nScriptHandle = sim.getScript( sim.scripttype_customization, "Script_GUI" );
argsRet = sim.callScriptFunction( "start", nScriptHandle, args );
Code: Select all
function start(args)
print(args)
end
1