I don't think the API supports schedules.
Sounds like what you need to do is retrieve the relevant elements, copy the mark parameter's value to the 'new mark' parameter and finally update the original mark parameter's value.
I haven't tested the following code snippets but they should point you in the right direction.
To get the relevant elements you need to use a FilteredElementCollector:
Code:
// Get the document
var document = this.ActiveUIDocument.Document;
// Create a collector for the current document
var collector = new FilteredElementCollector(document);
// Get all FamilyInstance elements
var elements = collector.OfClass(typeof(FamilyInstance)).ToElements().Cast<FamilyInstance>().ToArray();
This just gets all FamilyInstance elements, but you could modify the filtering to retrieve whatever elements you require. For more info about filtering, install the SDK and take a look at chapter 6 of the developer guide.
Next, sort the elements by their Mark so you can iterate over them and renumber as necessary.
Code:
// Sort the elements by their mark value
// Note that this assumes that the Mark parameter is stored as a string and that it contains integer values, if not then this will fail
var sortedElements = elements.OrderBy(e => int.Parse(e.get_Parameter("Mark").AsString())).ToArray();
Finally, you need to start a transaction so you can update the parameters. Then iterate over the sorted elements, copy / update the mark and then commit the transaction.
Code:
// Start a transaction
var transaction = new Transaction(document, "Copy Marks");
transaction.Start();
try
{
// Setup dictionary to track mark values
var elementsByMark = new Dictionary<int, FamilyInstance>();
// Process each element
foreach (var element in sortedElements)
{
// Get the parameters
var mark = element.get_Parameter("Mark");
var newMark = element.get_Parameter("New Mark");
// Copy the value from Mark to New Mark
newMark.Set(mark.AsString());
// Update Mark to ensure uniqueness
var markValue = int.Parse(mark.AsString());
while (elementsByMark.ContainsKey(markValue))
{
markValue++;
}
mark.Set(markValue.ToString());
elementsByMark.Add(markValue, element);
}
transaction.Commit();
}
catch (Exception)
{
transaction.RollBack();
throw;
}