|
Add method, ( TypeName As String, [URL], [Before] ) As Object.
Adds a new PROTO or EXTERNPROTO declaration to the specified Protos collection. Returns a Proto object that represents the PROTO declaration to be added.
TypeName A String, that represents the typename of a new PROTO or EXTERNPROTO declaration. A typename must be unique at the point of insertion of the PROTO, otherwise the method fails.
URL (Optional) If specified and nonEmpty, a new EXTERNPROTO declaration will be created. URL defines the external prototype's definition.
If a string expression, URL is full or relative URL or pathname to an existing local VRML file with the appropriate PROTO implementation. If the specified URL ends with "#name", the name PROTO statement is used to define the external prototype's definition. Otherwise the first PROTO statement found in the file (excluding EXTERNPROTOs) is used.
If an object expression, URL is Proto object, that represents the external definition of a new EXTERNPROTO declaration.
If an empty string, a new EXTERNPROTO will be created with an empty interface declaration and empty URL.
Before (Optional) An index of a new item in the collection. The PROTO declaration to be added is inserted in the collection before the PROTO identified by the Before argument.
If a numeric expression, Before must be a number from 1 to Count.
If a string expression, Before is a PROTO name that can be used instead of the positional index.
If an object expression, Before is a PROTO object from the collection or any Entity object with the same owner.
By default, a new PROTO declaration is inserted at the end of the collection.
The following example creates a PROTO declaration and an EXTERNPROTO declaration, that uses the PROTO as an external definition.
Dim SubDoc As Document
Set SubDoc = Document.NewSubdocument
Dim p As Proto
Set p = SubDoc.Protos.Add("MyProto")
SubDoc.Save "protos.wrl"
Document.Protos.Add "MyExtProto", p
|
|