Regular API function

simAddObjectToSelection / sim.addObjectToSelection

Description Adds an object to the selection. See also sim.removeObjectFromSelection and sim.getObjectSelection.
C synopsis simInt simAddObjectToSelection(simInt what,simInt objectHandle)
C parameters
what: indicates what we want to add. Valid values are sim_handle_single (adds just one object), sim_handle_all (adds all objects in the scene), sim_handle_tree (adds the tree with base objectHandle (inclusive)) and sim_handle_chain (adds the chain with tip objectHandle (inclusive))
objectHandle: handle of an object. Doesn't have a meaning if "what" is sim_handle_all
C return value
-1 if operation was not successful
Lua synopsis
There are two versions of this function:
(1) sim.addObjectToSelection(int what,int objectHandle)
(2) sim.addObjectToSelection(table[] objectHandles)
Lua parameters
(1) Similar to the C-function counterpart. The second argument can be omitted if "what" is sim.handle_all
(2) objectHandles: table of object handles. Can be nil
Lua return values
Remote API equiv.
B0-based remote API: simxSetObjectSelection
Legacy remote API: simxSetObjectSelection