Regular API function

simSetUserParameter / sim.setUserParameter

Description Sets user parameters of an object. Useful for simple interaction with the user. See also sim.getUserParameter, the data packing/unpacking functions and the user config callback functions.
C synopsis simInt simSetUserParameter(simInt objectHandle,const simChar* parameterName,const simChar* parameterValue,simInt parameterLength)
C parameters
objectHandle: handle of the object
parameterName: name of the parameter to set
parameterValue: value of the parameter (all parameters are treated as strings, but can be converted to number later on. Strings may contain any values (also embedded zeros))
parameterLength: number of bytes that parameterValue contains. If parameterValue is a regular string (without embedded zeros), then this is strlen(parameterValue).
C return value
-1 if the parameterName could not be found or in case of an error
Lua synopsis number returnValue=sim.setUserParameter(number objectHandle,string parameterName,string/number parameterValue)
Lua parameters
objectHandle: handle of the object, or sim.handle_self, to target the object the current script is attached to.
parameterName: Same as C-function
parameterValue: Same as C-function
Lua return values
Same as C-function

All regular API functions on one page