Multiple objects - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

The same applies for single and multiple objects. The line of code is practically identical to the single relation expansion.

Dim lobjParentMenuRels As IRelDictionary = lcolMenus.GetEnd2Relationships.GetRels("SPFMenuParent")

In the example above we take the collection of menus retrieved previously and expand the SPFMenuParent RelDef for each item. This runs one SQL statement that is considerably faster than doing them individually. Note that this uses GetEnd2Relationships, which expands up; that is, the ISPFMenu interface is UID2 on the RelDef.

Dim lobjMenuItemRels As IRelDictionary = lcolMenus.GetEnd1Relationships.GetRels("SPFMenuItems")

Dim lobjMenuItems As IObjectDictionary = lobjMenuItemRels.GetEnd2s

The example above expands down to menu items for each menu. The next line will get a collection of all the menu items that are related to a menu.