Rule to Filter and completing Objects Selection (EscItm_FilterListOfObjectsToBeItemized)

An opening ID is an entry point used to customize business logic. Using the EscItm_FilterListOfObjectsToBeItemized opening ID, you can define the logical objects allowed to be displayed during the architecture component creation. You can also create and instantiate customized architecture components objects through this business rule.

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

This page discusses:

General Information

This opening ID is invoked when using one of the following commands:

  • Replace Multiple Objects Using Architecture Components
  • Create Architecture Components
  • Associate Architecture Components with Logical Objects
  • Replace by Logical Facet
  • Create and Edit a Logical Facet
  • Create or Reuse Logical Facet
  • Remap Symbol Using Exposed Ports
  • Break Link with Architecture Components
.

Definition Description
PLM Opening ID Rule for filtering/completing applicative objects selection
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Logical Occurence
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Fact object Occurrence Read The occurrence containing the piping/electrical/HVAC design and linked to the architecture component system.
Input_ListSelectionOccurrence List Read The list of objects selected in CATIA. It contain logical occurrences.
Input_OperationID Integer Write The operation ID corresponding to the command that is calling the rule:

0: calls the rule from Create Architecture Components.

1: calls the rule from Associate Architecture Components with Logical Objects.

2: calls the rule from Create or Reuse Logical Facet.

3: calls the rule from Replace by Logical Facet.

4: calls the rule from Create and Edit a Logical Facet.

5: calls the rule from Replace Multiple Objects Using Architecture Components.

.
Input_ListObjectTypeNames List Read The list of the selected object type names.
Output_ListObjectsToItemize List Write The list of objects selected in CATIA. It contain logical occurrences.

This parameter is used for the following commands:

  • Create Architecture Components
  • Associate Architecture Components with Logical Objects
  • Break Link with Architecture Components

Output_ListCustomItemTypeString List Write The string value of the customized architecture component type object to create/instantiate.

The objects from this list must be mapped on one to one with the objects from the Output_ListObjectsToItemize list. If not, the default behavior applies, meaning the architecture component object type is Logical Reference.

Output_ListLinkWithItem List Write The list of integers that gives the preferred type of link to be created with the Item:

0: Occurrence link

1: Occurrence and reference link

Note: Other values are invalid, and if set, the whole list is ignored.
Output_ListBooleanAllowedTypes List Write The list of valid object type names supported for itemization.

This parameter is used for the following commands:

  • Create or Reuse Logical Facet
  • Associate Architecture Components with Logical Objects
  • Break Link with Architecture Components
  • Remap Symbol Using Exposed Ports
  • Create and Edit a Logical Facet

Output_ListIsTemporaryFacet List Write

This list identifies each object in the Input_ListSelectionOccurrence as a temporary facet.

A temporary facet is a non-itemizable object that will be replaced later during the design.

The list contains 0 or 1 where 1 indicates the corresponding object is a temporary facet

Filter Logical Objects

The following sample removes pipes and reducers from the selection.

let ListSelectedObjects(List)
let ListObjectsToItemize(List)
set ListSelectedObjects = Parameters.GetAttributeObject("Input_ListSelectionOccurrence")
//Go through the list and remove pipes
let LogicalPipeRef(Piping_Logical_Pipe)
let LogicalReducerRef(Piping_Logical_Reducer)
let LogicalOcc(LogicalOccurrence)
for LogicalOcc inside ListSelectedObjects
{	
	set LogicalPipeRef = LogicalOcc.Reference	
	set LogicalReducerRef = LogicalOcc.Reference
	//Keep only the objects that are not Pipes or Reducers
	if(LogicalPipeRef == NULL and LogicalReducerRef == NULL)
	{
		ListObjectsToItemize.Append(LogicalOcc)
	}	
}

Parameters.SetAttributeObject("Output_ListObjectsToItemize", ListObjectsToItemize)

Implement Link Definition

The following rule is set to make the Occurrence and Reference Link available when you launch Create Architecture Components. For the other commands, only the Occurrence Link option is available.

let ListSelectedObjects(List)
let ListObjectsToItemize(List)
let ListLinkWithItem(List)
let OperationID(Integer)
set ListSelectedObjects = Parameters.GetAttributeObject("Input_ListSelectionOccurrence")
set OperationID = Parameters.GetAttributeInteger("Input_OperationID")
//Go through the list and remove pipes
let LogicalPipeRef(Piping_Logical_Pipe)
let LogicalReducerRef(Piping_Logical_Reducer)
let LogicalOcc(LogicalOccurrence)
for LogicalOcc inside ListSelectedObjects
{	
	set LogicalPipeRef = LogicalOcc.Reference	
	set LogicalReducerRef = LogicalOcc.Reference
	//Keep only the objects that are not Pipes or Reducers
	if(LogicalPipeRef == NULL and LogicalReducerRef == NULL)
	{
		ListObjectsToItemize.Append(LogicalOcc)
//Set Occurrence and Reference link for Equipment
		if(OperationID == 0)
		{
			ListLinkWithItem.Append(1)
}
else
{
ListLinkWithItem.Append(0)
}
	}	
}

Parameters.SetAttributeObject("Output_ListObjectsToItemize", ListObjectsToItemize)
Parameters.SetAttributeObject("Output_ListLinkWithItem", ListLinkWithItem)

When the rule is set and its output is valid, the Link with Item option is initialized with the rule’s output, and you can change it manually when using the commands.

Custom Architecture Components Type

The following rule removes pipes and reducers from the selection and provides the custom architecture component type string as output (temporary use LogicalRef_CustomItem below which is to be replaced by actual custom type) corresponding to each object for the architecture component creation.

let ListSelectedObjects(List)
let ListObjectsToItemize(List)
let ListCustomItemTypeString (List)

set ListSelectedObjects = Parameters.GetAttributeObject("Input_ListSelectionOccurrence")
//Go through the list and remove pipes
let LogicalPipeRef(Piping_Logical_Pipe)
let LogicalReducerRef(Piping_Logical_Reducer)
let LogicalOcc(LogicalOccurrence)
for LogicalOcc inside ListSelectedObjects
{	
	set LogicalPipeRef = LogicalOcc.Reference	
	set LogicalReducerRef = LogicalOcc.Reference
	//Keep only the objects that are not Pipes or Reducers
	if(LogicalPipeRef == NULL and LogicalReducerRef == NULL)
	{
		ListObjectsToItemize.Append(LogicalOcc)

// Temporary use ‘LogicalRef_CustomItem’ below which is to be replaced by actual custom type
                             ListCustomItemTypeString.Append(“LogicalRef_CustomItem”)
	}	
}

Parameters.SetAttributeObject("Output_ListObjectsToItemize", ListObjectsToItemize)
Parameters.SetAttributeObject("Output_ListCustomItemTypeString", ListCustomItemTypeString)

Identify Non-Itemizable Objects

The following rule shows you how to identify non-itemizable objects that must be replaced.

In the below rule, all objects expect pipes and reducers are considered for itemization.

To filter the temporary facets, the V_description attribute on the instance is read and the string "TempFacet" is searched in it. If the “TempFacet” string is found on the V_description attribute, TRUE is append in output list Output_ListIsTemporaryFacet.

let ListSelectedObjects(List)
let ListObjectsToItemize(List)
let ListTempFacet(List)

set ListSelectedObjects = Parameters.GetAttributeObject("Input_ListSelectionOccurrence")

//Go through the list and remove pipes
let LogicalPipeRef(Piping_Logical_Pipe)
let LogicalReducerRef(Piping_Logical_Reducer)
let LogicalOcc(LogicalOccurrence)
for LogicalOcc inside ListSelectedObjects
{	
	set LogicalPipeRef = LogicalOcc.Reference	
	set LogicalReducerRef = LogicalOcc.Reference
	//Keep only the objects that are not Pipes or Reducers
	if(LogicalPipeRef == NULL and LogicalReducerRef == NULL)
	{
		ListObjectsToItemize.Append(LogicalOcc)
		
		let LogicalInst(RFLVPMLogicalInstance)
		set LogicalInst = LogicalOcc.Instance
		
		let tempFacetStr(String)
		set tempFacetStr = LogicalInst.GetAttributeString("V_description")
		
		let findx(Integer)
		findx = tempFacetStr .Search("TempFacet")
	
		if (findx <> -1 )
		{
			ListTempFacet.Append(LogicalOcc)
		}	
	}	
}