EKL - BL Schematic filter logical port to expose

Introduction

Usage :  filter the allowed ports on component while connecting to a routable internally or externally during routing.

Through this rule, user will be able to filter the ports of component that will be allowed to be connected to the routable.

Datasetup Resource Set : 

  • Diagram Resource

Datasetup Resource : Schematic_FilterLogicalPortToExpose

21xFD12LA - 22xFD04LA - 23xFD02LA 

  • Variable : RFLP_AUTO_SELECT_PORT

Rule Example 1

Description

In the below rule, we check whether the routable and component are from same system (Internal Connection case) or different system (external connection case).

If it is an external connection case, then we set the Boolean as TRUE (in output list) only for the ports with name “External_Port” else, we set the Boolean as FALSE.

Similarly, if it is an internal connection case, then we set the Boolean as FALSE (in output list) for all the ports with name “External_Port” else, we set the Boolean as TRUE.

This means for internal connection, all those ports are valid which does not have the name as “External_Port”

Note : Allow new port creation during routing process” should be unchecked as shown below.

Note - If the above setting is checked, Port Mapping Panel is always displayed even if only one valid port is found. No automatic selection in this case.

Rule

/* Rule created by RGH5 1/19/2022 */
//Get father occurrence of source object as input
let SourceFatherOccObject (LogicalOccurrence)
set SourceFatherOccObject = Parameters.GetAttributeObject ("Source_Father_Occ")

//Compute father reference of source object
let SourceFatherRefObject(RFLVPMLogicalReference)
set SourceFatherRefObject = SourceFatherOccObject.Reference

//Get occurrence of target object as input
let TargetOccObject(LogicalOccurrence)
set TargetOccObject = Parameters.GetAttributeObject ("Target_Object_Occ")

//Compute father occurrence of target object
let TargetFatherOccObject(LogicalOccurrence)
set TargetFatherOccObject = TargetOccObject.Owner

//Compute father reference of target object
let TargetFatherRefObject(RFLVPMLogicalReference)
set TargetFatherRefObject = TargetFatherOccObject.Reference

//Get list of ports of target object as input. This is the filtered list of ports of target object after doing basic compatibility checks for schematics
let PortListOfTarget(LIST)
set PortListOfTarget = Parameters.GetAttributeObject ("PortList_Target")

Let isize = 0
set isize = PortListOfTarget->Size()
Let j = 1

let OutputBooleanPortList(List)

//Loop over list of ports of target object
for j while j <= isize
{
                let PortObject(RFLVPMLogicalPort)
                set PortObject = PortListOfTarget->GetItem(j)
                
                let PortName(String)
                
                //Get attribute V_Name of the port
                set PortName = PortObject.PLM_ExternalID
                
                //Check if source and target are in same system
                if (TargetFatherRefObject == SourceFatherRefObject) //Same system
                {
                                //If V_Name matches with string “External_Port” Its an external port
                                if(PortName like '*External_Port*' )
                                {
                                                OutputBooleanPortList.Append(FALSE)
                                }
                                //Its an internal port
                                else
                                {
                                                OutputBooleanPortList.Append(TRUE)
                                }               
                }
                //different system
                else
                {
                                //Its an external port
                                if(PortName like '*External_Port*')
                                {
                                                OutputBooleanPortList.Append(TRUE)
                                }
                                //Its an internal port
                                else
                                {
                                                OutputBooleanPortList.Append(FALSE)
                                }               
                }
}

Parameters.SetAttributeObject("List_Boolean_Ports", OutputBooleanPortList)

3DXML