I would like to create a MEL script that creates a scene, setting up ncloth and passive collider objects and run the simulation up to a certain frame.
In the script editor, I can see the scene set-up but there is no function starting the simulation.
The technique that @Andreas suggests is sometimes called "command harvesting". It is a great way to learn what and how Maya is doing things. But to answer your specific question:
You can use
cmds.play()
to start playing back on Maya. See the docs for options.You might want to set the start frame and end frame of the playback range using the
cmds.playbackOptions()
command. See the docs for options.So you would do: (relevant explanatory comments added)
EDIT: I just noticed that you had asked for MEL commands. Just take the above commands and MEL-ify them, like so:
Suggestion: It is best to playblast this playback to watch it in proper fps and playback speed.
Hope that was useful.