Configuring SmartPlant Foundation to retrieve and view custom properties - SmartPlant Foundation - IM Update 46 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

To view custom properties of a retrieved objects, you must override the MapCustomPropertiesForRetrieve method in the SmartPlant Generic Adapter. The RetrieveDocument method on a generic adapter further processes the MapCustomPropertiesForRetrieve method and returns the collection of custom properties that you want to retrieve.

The syntax and the parameters for the MapCustomPropertiesForRetrieve method are described below:

Dictionary (Of String, Dictionary (Of String, String))

Arguments

Type

Description

Of String

String

Specifies the class definition of the target object.

Dictionary (Of String, String)

Dictionary

  • Of String is the key that specifies the property definition of the object on which the value must be assigned.

  • String is the value that contains the path to expand to get the value. This value is assigned to the property definition of the object.

The following example shows how to retrieve and view the Description property of an object published on a P&ID drawing to a line list authoring object:

  1. Load the schema changes to expose the SPFLLAPIDDescription property by the ISPFLLALineSegmentHeader interface. The following schema creates a property, SPFLLAPIDDescription, that is exposed by the interface ISPFLLALineSegmentHeader and maps that property to the PIDDescription property for line segments.

    <Container CompSchema="" Scope="" SoftwareVersion="04.02.00.14" IObject_ContainerID="" IObject_OBID="Auto" IObject_CreationDate="Now" IObject_TerminationDate="9999/12/31-23:59:59:999" IObject_LastUpdatedDate="Now" IObject_CreationUser="superuser" IObject_DomainUID="Auto" IObject_UniqueKey="Auto" IRel_DomainUID1="Auto" IRel_DomainUID2="Auto" >

    <Rel>

    <IObject UID="SPFLLAPIDDescription.string" ContainerID="LineList.LLAAuthSchema" />

    <ISchemaObj />

    <IRel UID1="SPFLLAPIDDescription" IsRequired="False" DefUID="ScopedBy" UID2="string" OrderValue="0" />

    </Rel>

    <PropertyDef>

    <IObject UID="SPFLLAPIDDescription" Name="SPFLLAPIDDescription" Description="PID Description where the Line Segment Appears" ContainerID="LineList.LLAAuthSchema" />

    <IPropertyDef />

    <ISchemaObj DisplayName="P&amp;ID Description" />

    </PropertyDef>

    <InterfaceDef>

    <IObject UID="ISPFLLALineSegmentHeader" Name="ISPFLLALineSegmentHeader" Description="Line Segment Header Information" ContainerID="LineList.LLAAuthSchema" />

    <IEnumMetadata />

    <IInterfaceDef />

    <IInterfaceRole />

    <ISchemaObj DisplayName="Line segment header information" />

    <IPropCategory />

    </InterfaceDef>

    <StringType>

    <IObject UID="string" Name="string" ContainerID="SchemaComponent.SchemaComponent" />

    <IPropertyType />

    <IStringType MaxChars="0" />

    <ISchemaObj DisplayName="String" />

    </StringType>

    <Rel>

    <IObject UID="ISPFLLALineSegmentHeader.SPFLLAPIDDescription" ContainerID="LineList.LLAAuthSchema" />

    <ISchemaObj />

    <IRel UID1="ISPFLLALineSegmentHeader" IsRequired="False" DefUID="Exposes" UID2="SPFLLAPIDDescription" OrderValue="70" />

    </Rel>

    </Container>

  2. Add the following code to retrieve SPFLLAPIDDescription to SPFLLALineSegment in the LLAAdapter.

    Code

  3. In the RetrieveDocument method of the generic adapter (TEFAdapter), set PropertyDictionaryToBeSetAfterRetrieve to MapCustomPropertiesForRetrieve().