ParallelGraphics  
Home  »  Developer Zone  »  Products  »  VrmlPad  »  References  »  Routes
Routes

Routes Collection

 
Add
 
Count
 
Item
 
_NewEnum
See also: Using collections.
 
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.




 
Count property, read-only, Long.

Returns the number of items in the specified collection.




 
Item property, default, read-only, ( Index ) As Object.

Returns a Route object that represents a member of the collection by position.

Index
The index number of a member of the collection. The index should be a numeric expression (a number from 1 to the value of the collection's Count property).
If the value provided as Index doesn't match any existing member of the collection, an error occurs.

The following example prints target node typenames for all routes (in the global context) from a TimeSensor nodes.

Dim r As Route
Dim n As Node
Set n = Document.StdProtos("TimeSensor")
For i = 1 To Document.Routes.Count
  Set r = Document.Routes(i)
  If r.FromNode = n Then Debug.Print r.ToNode.TypeName
Next




 
_NewEnum property, read-only.

References routes in the specified collection.

With C++, you can browse a collection to find a particular item by using the _NewEnum or the Item properties. In Visual Basic and VBScript, you do not need to use the _NewEnum property, because it is automatically used in the implementation of For Each ... Next or in For ... in statement in JavaScript.

The following example prints target node typenames for all routes (in the global context) from a TimeSensor nodes.

Dim r As Route
Dim n As Node
Set n = Document.StdProtos("TimeSensor")
For Each r In Document.Routes
  If r.FromNode = n Then Debug.Print r.ToNode.TypeName
Next






Last updated: Wed, 19 Nov 2008
© 2000-2008 ParallelGraphics. All rights reserved.