Regular API function

simAssociateScriptWithObject / sim.associateScriptWithObject

Description Sets the associated object of a child script. Use with care when simulation is running. See also sim.getObjectAssociatedWithScript, sim.addScript and sim.setScriptText.
C synopsis simInt simAssociateScriptWithObject(simInt scriptHandle,simInt objectHandle)
C parameters
scriptHandle: handle of the child script
objectHandle: handle of the associated object, or -1 to remove the association
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis number result=sim.associateScriptWithObject(number scriptHandle,number objectHandle)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page