Add function (automation interface)
Syntax:
Add("<association>")
Add("<association>",<object>)
Add("<association>","<value>")
Where:
<association> is a string that specifies the association type to use. Identifying associations...
<object> is an object that specifies an object to link through the specified association type. Identifying objects...
<value>
is a string that specifies the value to use for the default property of the new item, which typically is the name of the item.
The Add function adds an object to an existing object using a specified association and returns the new object.
If no object or value is given a new object is created and linked.
If an object is given, the passed object is linked.
If a string value is given then a new object is created with its default property set to the value passed, if the multiplicity and name uniqueness rules for the requested association allow. If an object already exists with the value passed, the existing object is returned.
* 
The Add function does not remove linked objects.
If you want to add Parts or Ports, or add Associations from Parts or Ports, use the AddDirected function.
If you want to create objects of a specific type through a specified association, use the AddByType function.
Examples
To add a new Attribute (allowing Modeler to assign a default name) to a Class named Class1:
Set objItem = Dictionary.Item("Class", "Class1")
Set Op1 = objItem.Add ("Attribute")
To add a new Attribute named Start to a Class named Class1:
Set objItem = Dictionary.Item("Class", "Class1")
Set Op1 =objItem.Add ("Attribute", "Start")
To link an existing Attribute named Stop to a Class named Class1:
Set objItem = Dictionary.Item("Class", "Class1")
Set objItemToLink = Dictionary.Item("Attribute", "Stop")
Set Op1 = objItem.Add ("Attribute", objItemToLink)
Was this helpful?