Regular API function

simRemoveModel / sim.removeModel (remote API equivalent: simxRemoveModel)

Removes a model from the scene. See also sim.removeObject.
Threaded child scripts can only destroy models that do not contain other scripts attached than itself.
Object destruction always tries to destroy attached scripts before destroying the object itself. If a script tries to destroy the object it is attached to, then the object will first be destroyed, and the script destruction will be delayed.
C synopsis simInt simRemoveModel(simInt objectHandle)
C parameters
objectHandle: handle of the model (i.e. object tagged as model) to remove.
C return value
-1 if operation was not successful, otherwise the number of removed objects (a model might contain several objects)
Lua synopsis number removedCnt=sim.removeModel(number objectHandle)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page