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, or simmodel.xml)
C return value
-1 if operation was not successful
Lua synopsis
string buffer=sim.saveModel(int baseOfModelHandle,string filename=nil)
Lua parameters
baseOfModelHandle: handle of an object marked as "Object is model base"
filename: model filename. The filename extension is required (ttm, or simmodel.xml ). If this argument is omitted, then the model will be saved to a buffer which will be returned
Lua return values
buffer: a buffer containing the saved model, if the model was specified to be saved to memory.