|
 |  | Node
|
Node Object
See also: Entity object.
| |

 |
Context property, read-only, Object.
Returns a Proto object that represents the PROTO context (namespace) for the specified node. Returns Nothing, if the node is in the global context (isn't part of a PROTO declaration).
See also: Context property of the Entity object.
|

| |

 |
Delete method.
Deletes the specified node.
In the case of a named node, all references to the node will also be deleted. If the node definition contains declarations that have references outside the specified node, all such references will be deleted as well.
See also: Delete method of the Entity object.
|

| |

 |
DeleteInstance method.
Deletes the specified instance of the node.
In the case of a node definition, next instance (USE) of the node will be replaced with a copy of the deleted node.
The following example wraps a first root node of the document in a Group node.
Dim n As Node
Set n = Document.RootNodes(1)
Document.RootNodes.Add("Group", n.Range)("children").Add n
n.DeleteInstance
|
|

| |

 |
Document property, read-only, Object.
Returns a Document object that represents the VRML file contains the specified node.
|


| |

 |
Fields property, default, read-only, Object.
Returns a Fields collection that represents a set of fields and events of the specified node.
The collection is read-only for most types of node, except of the Script node type.
The following example creates a Script node and adds an interface field declaration.
Dim n As Node
Set n = Document.RootNodes.Add("Script")
n("url") = "javascript:" + vbCrLf + "function onClick(){}"
n.Fields.Add vpcEventIn, vpfSFTime, "onClick", "url"
|
Some fields and most events may implicitly be a members of the collection, in other words the Fields collection includes not only fields explicitly defined in a scope of the node, but also fields and events of the prototype of the node.
The following example explicitly defines all fields in a node.
Dim f As Field
For Each f In Document.RootNodes(1).Fields
f.Implicit = False
Next
|
So, the specified collection consist of explicitly defined field definitions, implicit fields and events, that is actually field declarations in a PROTO interface and, in the case of a Script node - field and event declarations.
The following Visual Basic example enumerates all fields of a node and prints it's type.
Dim f As Field
For Each f In Document.RootNodes(1).Fields
If f.Implicit Then
Debug.Print f.Name & " : implicit field definition"
ElseIf f.EntityType = vpFieldDecl Then
Debug.Print f.Name & " : field declaration"
Else
Debug.Print f.Name & " : field definition"
End If
Next
|
|

| |

 |
InRoutes property, read-only, Object.
Returns a Routes collection that represents a set of incoming routes of the specified node.
The collection is read-only, so you can't add new routes to the collection.
The following example enumerates all incoming routes to a field.
Private Sub IncomingRoutes(f As Field)
Dim n As Node
Set n = f.Owner
Dim r As Route
For Each r In n.InRoutes
If r.ToField Is f Then
Debug.Print "Routed from " & r.FromField.Name
End If
Next
End Sub
|
See also: OutRoutes property.
|

| |

 |
Matrix property, read/write, Object.
Gets or sets a matrix of transformation of the specified node as a VrmlMatrix object. For all node types, except Transform and Viewpoint, returns identity matrix.
See also: ApplyTransform method of the VrmlMatrix object.
|

| |

 |
Name property, read/write, String.
Gets the name of the node (by means of the DEF/USE syntax) or sets the name of the node definition. Returns an empty string, if the node has no name.
Renaming the node definition also renames all it's references (USEs and ROUTEs), if any.
A new name for the node must be unique in context of the node, otherwise the property fails.
Assigning an empty string ("") to the property unnames the node definition, unless the node has a references.
The following example unnames all named but unreferenced nodes (in the global context).
Dim n As Node
For Each n In Document.Nodes
If n.References.Count = 0 And _
n.InRoutes.Count = 0 And _
n.OutRoutes.Count = 0 Then n.Name = ""
Next
|
See also: Name property of the Entity object.
|

| |

 |
OutRoutes property, read-only, Object.
Returns a Routes collection that represents a set of outgoing routes of the specified node.
The collection is read-only, so you can't add new routes to the collection.
See also: InRoutes property.
|

| |

 |
Owner property, read-only, Object.
Returns an Entity object that represents the immediate owner of the specified node.
It's a Field object for the member of a MFNode or SFNode field, a Proto object for the toplevel node in a PROTO declaration, or Nothing for the root node.
See also: Owner property of the Entity object.
|

| |

 |
Prototype property, read-only, Object.
Returns a Proto object that represents the PROTO or the standard node type declaration of the specified node.
The following example return True if a node is a PROTO-instance and False if it is a standard node.
Private Function IsProtoInstance(n As Node)
IsProtoInstance = Not n.Prototype.Standard
End Function
|
|


| |

 |
References property, read-only, Object.
Returns a Nodes collection that represents all instances (clones) of the node, excluding the specified node itself. It's a set of references for the node definition and a node definition (first member of the collection) and other references for the node reference.
|

| |

 |
RootRoutes property, read-only, Object.
Returns a Routes collection that represents a set of routes in a immediate scope of the specified node. Adding a route to this collection inserts the appropriate ROUTE statement at the end of the node definition.
|

| |

 |
TypeName property, read-only, String.
Gets the typename of the specified node.
The following expressions always return the same result.
|

|
|
|