Enumerator Description

When retrieving a list of items it is necessary to identify the general group or container as it is refered to in ProDesigner COM server, that your items belong to. Therefore, there are lists that are contained in a flowsheet, lists that are contained in a unit procedure (like the in/out streams for a unit procedure above), or lists that are contained in a section (like the list of equipment employed in a particular section above). In other words, in order to describe the list one needs to specify:

a)     The type of items we wish to retrieve (like unit procedures, equipment, streams, etc.), and

b)  The container object (e.g. the flowsheet, a specific unit procedure or a specific section)

For this purpose, ProDesigner’s COM interface includes pair of functions that allow a user to enumerate and retrieve several lists from an ".spf" file. These pair of functions are:

StartEnumeration  (position as Variant, listID as ListTypeID,
containerID as ContainerTypeID, containerName as String
) As Boolean

and

GetNextItemName  (position as Variant,          itemName as Variant,
listID as ListTypeID, containerID as ContainerTypeID,

containerName as String) As Boolean.

StartEnumeration2  (position as Variant, listID as ListTypeID,
containerID as ContainerTypeID, containerName1 as String,
containerName2 as String
) As Boolean

and

GetNextItemName2  (position    as Variant,
itemName    as Variant, listID as ListTypeID, containerID as ContainerTypeID, containerName1 as String, containerName2 as String
) As Boolean

which require extra information (container 2 object is part of another container 1 object).

The Specifying Container Type and Specifying Item List Type are enums (constants) that are defined and exported by the COM engine.

We will demonstrate the use of the above pair of enumeration functions of the COM interface in the following examples:

         Enumerating All Unit Procedures in a Flowsheet,

         Enumerating All Input Streams in a Unit Procedure,

         Enumerating All Unit Procedures in All Sections in All Branches .

      Enumerating All Consumables in All Consumable Categories

Please note that not all combinations between container-type IDs and list type IDs are meaningful, and amongst all pairs that may be meaningful, not all of them are currently implemented. To find out which {container, list-type} are currently implemented please view the topic:

      Item Lists & Containers 

To see example scripts on how to use the above enumerator functions please view the ComEx8.xls file in the COM folder located under the “EXAMPLES” folder under your application’s installation directory.