Regular API function

simAddItemToCollection / sim.addItemToCollection

Description Adds an item to a collection. See also the other functions related to collections.
C/C++
synopsis
simInt simAddItemToCollection(simInt collectionHandle,simInt what,simInt objectHandle,simInt options)
C/C++
parameters
collectionHandle: the handle of a collection.
what: the type of object (or group of objects) to add. Following are allowed values: sim.handle_single (for a single object), sim.handle_all (for all objects in the scene), sim.handle_tree (for a tree of objects), or sim.handle_chain (for a chain of objects (i.e. an inverted tree)).
objectHandle: the handle of an object.
options: bit-coded options:
bit 0 set (1): the specified object (or group of objects) is removed from the collection. Otherwise it is added.
bit 1 set (2): the specified object is not included in the group of objects, if sim.handle_tree or sim.handle_chain is specified (i.e. the tree base or tip is excluded).
C/C++
return value
-1 if operation was not successful.
Lua
synopsis
sim.addItemToCollection(int collectionHandle,int what,int objectHandle,int options)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Python
synopsis
sim.addItemToCollection(int collectionHandle,int what,int objectHandle,int options)

<