The GetObjectByOBID method - 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

One of the most frequent operations is to request data from the server. Most commonly, this is done via the various Get methods on the SPFSession object. From within your Client API, the session is available as Me.SPFSession. To retrieve an object via its OBID, you use the GetObjectByObid method.

For performance this should be called with a DomainUID as it will be much faster. It will return IObject and has been overloaded. You can pass in a container, and it will place the item into that container.

Public Function GetObjectByOBID(ByVal pstrOBID As String) As IObject

Public Function GetObjectByOBID(ByVal pstrOBID As String,

ByVal pstrDomainUID As String) As IObject

Public Function GetObjectByOBID(ByVal pstrOBID As String,

ByVal pstrDomainUID As String,

ByVal pobjContainer As ContainerObjectDictionary) As Iobject

An example of calling this method is as follows…

Dim lobjSomeObject As IObject = Me.SPFSession.GetObjectByOBID(lstrSomeObid)

  • Unlike SmartPlant Foundation version 3.x, when an object is returned to the client, all the interfaces and properties are returned with it. There is no need to make an additional call to get any other properties.

  • For properties scoped by UOM, SmartPlant Foundation does not send back the UOM to the client, just the value. This API was written for a refresh of existing objects on the client. The classes in the client already have the object and all property values including UOMs. If the value has changed after a call to GetObjectByOBID, it is refreshed. There are several other APIs available on the client that return UOM information, namely GetObjectByUIDAndDomain, GetObjectByName, and GetObjectsByUID.