|
Add method, ( FromField As Object, ToField As Object, [Before] ) As Object.
Adds a new route to the specified Routes collection. Returns a Route object that represents the route to be added.
FromField A Field object that represents the eventOut or exposedField, generating events through a new route.
ToField A Field object that represents the eventIn or exposedField, receiving events through a new route.
Before (Optional) An index of a new item in the collection. The route to be added is inserted in the collection before the route identified by the Before argument.
If a numeric expression, Before must be a number from 1 to Count.
If an object expression, Before is a Route object from the collection or any Entity object with the same owner.
By default, a new route is inserted at the end of the collection.
The following example creates a route at the end of the document and selects it.
Dim n1 As Node
Dim n2 As Node
Dim r As Route
Set n1 = Document.RootNodes.Add("TimeSensor")
Set n2 = Document.RootNodes.Add("ScalarInterpolator")
Set r = Document.Routes.Add(n1("fraction_changed"), n2("set_fraction"))
r.Range.Select
|
See also: RouteTo method of the Field object.
|