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

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

| |

 |
Delete method.
Deletes the specified PROTO.
All instances of the PROTO will also be deleted.
See also: Delete method of the Entity object.
|

| |

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


| |

 |
Fields property, default, read-only, Object.
Returns a Fields collection that represents a set of interface field and event declarations of the specified PROTO or EXTERNPROTO.
The following example creates a PROTO declaration with an interface field declaration.
Dim p As Proto
Set p = Document.Protos.Add("MyProto")
p.Fields.Add vpcField, vpfSFBool, "enabled"
p("enabled") = True
|
Each field or event declaration in the collection supports the Implements property that returns a collection of fields, implementing the PROTO field declaration using the IS syntax. To add or remove an implementation of the field or event declaration, you may use the Interface property or the Expose method of the field, you are going to expose to the specified PROTO interface declaration.
The following example clears implementations of all PROTO field declarations.
Dim p As Proto
Set p = Document.Protos("MyProto")
Dim f As Field
For Each f In p.Fields
For Each i In f.Implements
i.Interface = Nothing
Next
Next
|
|

| |

 |
Instances property, read-only, Object.
Returns a Nodes collection that represents all PROTO-instance nodes of the specified PROTO declaration.
The following example enumerates all Inline nodes and prints for each node first url field value.
Dim n As Node
For Each n In Document.StdProtos("Inline").Instances
Debug.Print n("url")(1)
Next
|
See also: Prototype property of the Node object.
|

| |

 |
Name property, read/write, String.
Gets or sets the name of the specified PROTO declaration.
Renaming the PROTO declaration also renames types of all PROTO-instance nodes of that PROTO.
A new name for the PROTO must be unique, otherwise the property fails.
See also: Name property of the Entity object.
|

| |

 |
Nodes property, read-only, Object.
Returns a Nodes collection of all nodes in context of the specified PROTO declaration given a name using the DEF keyword.
This collection is read-only, use the RootNodes property to add a new node to the PROTO definition.
See also: Nodes property of the Document object.
|

| |

 |
Owner property, read-only, Object.
Returns an Entity object that represents the immediate owner of the specified PROTO declaration.
See also: Owner property of the Entity object.
|

| |

 |
Protos property, read-only, Object.
Returns a Protos collection of all PROTO declarations available from the context of the specified PROTO declaration.
See also: Protos property of the Document object.
|


| |

 |
RootNodes property, read-only, Object.
Returns a Nodes collection of all top-level nodes of the specified PROTO declaration.
The PROTO declaration defines PROTO-context (namespace) for all nodes from the collection as well as for its children nodes.
The collection is always empty and read-only for the EXTERNPROTO declaration.
The following example creates a PROTO declaration, adds a TimeSensor node to it and exposes enabled field of the node to the PROTO interface.
Dim p As Proto
Set p = Document.Protos.Add("MyProto")
Dim n As Node
Set n = p.RootNodes.Add("TimeSensor")
n("enabled").Expose
|
See also: RootNodes property of the Document object.
|

| |

 |
Routes property, read-only, Object.
Returns a Routes collection of all ROUTEs in context of the specified PROTO declaration.
The collection is always empty and read-only for the EXTERNPROTO declaration.
See also: Routes property of the Document object.
|

| |

 |
Source property, read-only, Object.
Returns a Proto object that represents the PROTO implementation or the specified EXTERNPROTO declaration.
The string or strings specified after the EXTERNPROTO interface declaration give the location of the prototype implementation. If a URL string refers to an existing local VRML file and the appropriate PROTO implementation is found, it returns by the property. Otherwise the property fails.
In the case of the PROTO declaration, the property returns the same object.
See also: Add method of the Protos collection.
|

| |

 |
Standard property, read-only, Boolean.
Returns True if the specified PROTO declaration is a standard VRML node type declaration.
A standard PROTO declaration is a read-only object - you can't change name, delete or modify by other ways standard PROTOs. You can't also get text range for the standard PROTO, because it has no associated text. The Nodes and RootNodes properties always return empty Nodes collection in the case of the standard PROTO declaration.
See also: Standard property of the Entity object, StdProtos property of the Document object.
|

| |

 |
URL property, read-only, Object.
Returns a Field object that represents the URL pseudo-field of the specified EXTERNPROTO declaration. In the case of the PROTO declaration, the property returns Nothing.
The URL pseudo-field has the EntityType = vpProtoURL = 7 and MFString field type.
The following example creates an EXTERNPROTO declaration and inserts a value to the URL.
Dim p As Proto
Set p = Document.Protos.Add("Avatar", "avatar.wrl")
p.URL.Add "urn:inet:dot.com:lib:avatar", 1
|
See also: Add method of the Protos collection.
|

|
|
|