Regular API function

simSaveModel / sim.saveModel

Description Saves a model (an object marked as "Object is model base" and all other objects in its hierarchy tree). Any existing file with same name will be overwritten. See also sim.loadModel, and sim.saveScene.
C synopsis simInt simSaveModel(int baseOfModelHandle,const simChar* filename)
C parameters
baseOfModelHandle: handle of an object marked as "Object is model base"
filename: model filename. The filename extension is required ("ttm")
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis
a) number result=sim.saveModel(number baseOfModelHandle,string filename)
b) string buffer=sim.saveModel(number baseOfModelHandle)
Lua parameters
baseOfModelHandle: handle of an object marked as "Object is model base"
filename: model filename. The filename extension is required ("ttm"). If this argument is omitted, then the model will be saved to a buffer which will be returned
Lua return values
a) -1 if operation was not successful
b) nil if operation was not successful, or a buffer containing the saved model

All regular API functions on one page