##In console
$video_folder = "D:/video/exported/"
$i = 0
$export = false

#Start balise
$export = true

#End balise
$export = false

##Animation settings
delta t: 0.1
move trains according to: delta t

##In animation settings code
return unless $export
keys = {
:filename => $video_folder + $i.to_s + ".jpg",
:width => 640,
:height => 480,
:antialias => true,
:compression => 1,
:transparent => false
}
m = Sketchup.active_model
v = m.active_view
v.write_image keys
$i += 1