Regular API function

simSetObjectParent / sim.setObjectParent

Description Sets an object's parent object. See also sim.getObjectParent.
C synopsis simInt simSetObjectParent(simInt objectHandle,simInt parentObjectHandle,simBool keepInPlace)
C parameters
objectHandle: handle of the object that will become child of the parent object. Can be combined with sim_handleflag_assembly (simply add sim_handleflag_assembly to objectHandle), if the two objects can be assembled via a predefined assembly transformation (refer to the assembling option in the object common properties). In that case, parentObjectHandle can't be -1, and keepInPlace should be set to false.
parentObjectHandle: handle of the object that will become parent, or -1 if the object should become parentless.
keepInPlace: indicates whether the object's absolute position and orientation should stay same
C return value
-1 if operation was not successful
Lua synopsis sim.setObjectParent(int objectHandle,int parentObjectHandle,boolean keepInPlace)
Lua parameters
Similar to the C-function counterpart
Lua return values
Remote API equiv.
B0-based remote API: simxSetObjectParent
Legacy remote API: simxSetObjectParent