Regular API function

simLoadModel / sim.loadModel (remote API equivalent: simxLoadModel)

Description Loads a previously saved model, and selects it. See also sim.saveModel, sim.loadScene, and sim.setBoolParameter with sim.boolparam_scene_and_model_load_messages.
C synopsis simInt simLoadModel(const simChar* filename)
C parameters
filename: model filename. The filename extension is required ("ttm")
C return value
-1 if operation was not successful. Otherwise the handle of the model base object.
Lua synopsis
a) number objectHandle=sim.loadModel(string filename)
b) number objectHandle=sim.loadModel(string buffer)
c) string rgbaImage=sim.loadModel(string filename,bool onlyThumbnail)
d) string rgbaImage=sim.loadModel(string buffer,bool onlyThumbnail)
Lua parameters
a) filename: model filename. The filename extension is required ("ttm")
b) buffer: a buffer containing the model
c)&d) onlyThumbnail: when true, then only the thumbnail image of the model will be loaded and returned
Lua return values
a)&b) -1 if operation was not successful. Otherwise the handle of the model base object.
c)&d) nil if operation was not successful. Otherwise the model thumbnail image (128x128x4, rgba).

All regular API functions on one page