Compute the List of Mechanical Accessories (EAP_ListMechanicalAccessories)

An opening ID is an entry point used to customize business logic. The Compute list of mechanical accessories opening ID is available in the Electrical physical system design resources set.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This business rule applies when listing the mechanical accessories of a device. It lets you filter the resulting list of mechanical accessories.

Definition Description
PLM Opening ID EAP_ListMechanicalAccessories
Customization intent Computation
Execution context Client

Input Objects

The input objects must be of the following types:

  • ThisObject
  • Parameters, which corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Connector VPMOccurrence Read The object where the mechanical accessories are placed.
ListofMechanicalAccessories List of VPMOccurrence Read All the mechanical accessories connected to the connector.
ListOfFilteredMechanicalAccessories List of VPMOccurrence Write A list of mechanical accessories filtered according to the user’s specified criteria.

Sample

You can filter out piping parts, which are considered as mechanical accessories in the data structure. As a result, when listing connected mechanical accessories, piping parts are excluded from the results.

Let InList (List)
Let OutList (List)
Let Size (Integer)
Let i (Integer)
Let AccOcc (ProductOccurrence)
Let ValveOcc (Piping_Part_Occurrence)
Let Kept (Integer)

InList = Parameters->GetAttributeObject("iListofMechanicalAccessories")
Size = 0
Kept = 0
If (InList <> NULL)
{
  Size = InList.Size()
  i = 1
  For i While i <= Size
  {
    AccOcc = InList->GetItem(i)
    Set ValveOcc = AccOcc
    If (ValveOcc == NULL)
    {
      OutList.Append(AccOcc)
      Kept = Kept + 1
    }
    i = i + 1
  }
}
Parameters->SetAttributeObject("oListOfFilteredMechanicalAccessories", OutList)
Parameters->SetAttributeString("Message", "Filtered=" + ToString(Kept) + "/" + ToString(Size))
Parameters->SetAttributeInteger("Severity", 0)