Meta Data Services Programming
Repository CreateObject Method
This method creates a new repository object of a certain type. You can specify this method in application code to create an instance of a class defined in an information model.
Syntax
Set variable = object.CreateObject(typeId, objectId)
The CreateObject method syntax has the following parts.
Part | Description |
---|---|
variable | Declared as a RepositoryObject or RepositoryObjectVersion. It receives the new RepositoryObject or RepositoryObjectVersion. |
object | The object that represents the open repository instance through which application code or a tool interacts with a repository. |
typeId | The object identifier of the class to which the new object conforms. For example, to create an instance of a Storage class, specify the object identifier of the Storage class. |
objectId | The object identifier to be assigned to the new object. Either pass in ObjID_NULL, or leave it unspecified to have an object identifier assigned automatically. |
Remarks
Use this method to create the first version of a new RepositoryObject. To create subsequent versions, use the CreateVersion method of the RepositoryObjectVersion object.
This method can be called from a shared repository but not from a workspace. The workaround is to create the object through the central repository and include it in the workspace.
See Also
Choosing an Automation Server for a Class