Using Collections

A collection within the Maxsurf object model is a container for storing an ordered group of objects. It is essentially the equivalent of an array within VBA but its implementation has been encapsulated within an object. As such, it provides some methods and properties for accessing the items within the collection. The content of a collection is not arbitrary; in fact its contents correspond directly to the components of the model. As such, adding an item to a collection adds a corresponding component to the design. For example, all the surfaces representing a design are contained within a Surfaces collection object stored within the Design object. Adding a new surface to the design is performed by adding a new surface to the Surfaces collection.

 

All collection objects have a number of common properties and methods for manipulating their content. These are summarised in the tables below.

 

Property

Type

Description

Count

Long

Read Only. Returns the number of items in list.

 

Method

Returns

Description

Add

 

Add objects to list

Item(int)

Object

Returns the ith item in list.