With the cursor in the “marker” position, all you need is the following:
myVegas.Transport.SelectionStart = myVegas.Transport.CursorPosition – new Timecode(“00:00:15:00”);
myVegas.Transport.SelectionLength = new Timecode(“00:00:30:00”);
That start a selection area 15 seconds before the cursor and then create a selection area for a length of 30 seconds. Naturally, it will need to be wrapped in the code to make it a full script. Just copy the text below and save it in a file name “CreateSelectionArea.cs”
//
// Create Selection Area 30 seconds around cursor
//
// By Edward Troxel – March 12, 2016
using System;
using System.IO;
using System.Text;
using Sony.Vegas;
public class EntryPoint
{
Vegas myVegas;
public void FromVegas(Vegas vegas)
{
myVegas = vegas;
myVegas.Transport.SelectionStart = myVegas.Transport.CursorPosition – new Timecode(“00:00:15:00”);
myVegas.Transport.SelectionLength = new Timecode(“00:00:30:00”);
}
}
Edward Troxel