Regular API function

simAddObjectToCollection / sim.addObjectToCollection

Description Adds an object (or a group of objects) to a collection. See also sim.emptyCollection, sim.removeCollection, sim.getCollectionHandle, sim.getObjectHandle, sim.getCollectionObjects and sim.createCollection.
C synopsis simInt simAddObjectToCollection(simInt collectionHandle,simInt objectHandle,simInt what,simInt options)
C parameters
collectionHandle: the handle of a collection.
objectHandle: the handle of an object.
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)).
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 return value
-1 if operation was not successful.
Lua synopsis number result=sim.addObjectToCollection(number collectionHandle,number objectHandle,number what,number options)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page