Use relationships instead of edges - SmartPlant Foundation - IM Update 48 - 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)

Some systems have many edges defined for the shortcut menu that expand the same relationship, but apply some interface criteria. For example, all related objects are tags, but the tags are grouped into disciplines. Each discipline tag has a different interface so that the edges show electrical tags, piping tags, mechanical tags, and instrument tags as separate options on the shortcut menu.

A separate relationship for each type of tag can be modeled instead of one relationship with multiple edges to filter them. These can all be specializations of the same parent abstract relationship if expansion is needed in an all-tags type of option.

The following code shows the type of edge described, using folders as the example:

<EdgeDef>

<IObject UID="EDG_Test " Name="Test" Description="All objects related to a folder that are doc revisions" />

<IEdgeDef StartInterfaceName="ISPFFolder" PathDefn="+SPFFolderIObject" ValidEndInterfaceDefUIDs="ISPFDocumentRevision" />

<IEdgeDef2 FilterEdge="True" />

<ISimpleCriteria PropComparisons="" />

<IPositionCriteria />

<ISchemaObj />

</EdgeDef>

This edge navigates from a folder, along the FolderIObject relationship, and applies criteria requiring that the end object must have instantiated the ISPFDocumentRevision interface.

Use a specific relationship that is a specialization of the SPFFolderIObject relationship instead. The following code shows the FolderIObject relationship definition (the abstract relationship) and the SPFFolderDocumentRevision relationship definition (the specialization relationship). Additional specializations of SPFFolderIObject also appear in the schema. The following example shows functionality of the relationship under the edge:

<RelDef>

<IObject UID="SPFFolderIObject" Name="SPFFolderIObject" Description="Abstract folder contents relationship"/>

<IRel UID1="ISPFFolder" UID2="IObject"/>

<IRelDef Role1="Folders" End1Locality="Across" Min1="0" Max1="*" IsAbstract="True" Min2="0" Max2="*" End2Locality="Across" Role2="Contents"/>

<IRelDef2 FilterEdge12="True" Copy12="#1" Copy21="#0"/>

<ISchemaObj/>

<ISPFRelDefExt/>

</RelDef>

The following code illustrates good relationships for the shortcut menu to replace the edge:

<RelDef>

<IObject UID="SPFFolderDocumentRevision" Name="SPFFolderDocumentRevision" Description="Specialized relationship for document revisions"/>

<IRel UID1="ISPFFolder" UID2="ISPFDocumentRevision"/>

<IRelDef Role1="DocumentRevisionFolders" Role1DisplayName="Folders" End1Locality="Across" Min1="0" Max1="*" SpecOfUID="SPFFolderIObject" IsAbstract="False" Min2="0" Max2="*" End2Locality="Across" Role2="DocumentRevisions" Role2DisplayName="Document Revisions"/>

<IRelDef2 FilterEdge12="True" FilterEdge21="True" Copy12="#1" Copy21="#0"/>

<ISchemaObj/>

<ISPFRelDefExt SPFCascade21="#9270"/>

</RelDef>