General InformationThis opening ID is invoked when using one of the following commands:
Input ObjectsInput objects must be of the following types:
Context Object Parameters
Filter Logical ObjectsThe 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 DefinitionThe 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 TypeThe 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 ObjectsThe 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
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)
}
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||