Electrical User Functions

This topic provides you with information about electrical user functions.

Important: Activate the ElectricalMeasure package.


  • Select Tools > Options... > General > Parameters and Measures.
  • Select the Knowledge Environment tab.
  • Select Electrical Functions from the list of available packages and click the Down arrow to load this package:
  • Click OK to validate.

BranchExtremity

The BranchExtremity user function can be used in Knowledge Expert.

Syntax

BranchExtremityBranch > Elec_BrancExtremities (BranchExtremity1: out SegmentEnd, BrandExtremity2: out SegmentEnd): Boolean Package: ElectricalFunctions

ComputedMinAngle

The ComputedMinAngle user function can be used in Knowledge Expert.

Syntax

ComputedMinAngle Wire > ComputedMinAngle (MinBendRadius: out Angle, Segment1: out Segment, Segment2: out Segment): Boolean Package: ElectricalFunctions

ComputedMinBendRadius

The ComputedMinBendRadius user function can be used in Knowledge Expert.

Syntax

ComputedMinBendRadius Wire > ComputedMinBendRadius (MinBendRadius: out Length, Segment: out Segment): Boolean Package: ElectricalFunctions

DistanceWireProduct

The DistanceWireProduct user function can be used in Knowledge Expert.

Syntax

DistanceWireProduct (Wire1: Wire, Object: Product):Length

Returns the minimum length between a conductor and a product in session. The product must contain at least one 3D shape.

Example 1

The DistanceWireProduct user function can be used with the f(x) command to display the distance between a wire and a component in the session. This formula:

DistanceWireProduct(EB.1\Wire.1 ,GB1.1\Muffler.1 )
returns the following value:
171.964mm

Example 2

The DistanceWireProduct user function can be used in Knowledge Expert to find all the wires in the session that have a minimum distance to defined components smaller than a critical value chosen by the user. The components can be defined as heat-resistant. Properties have been added to the product (load the ElectricalMeasure package) and to the conductors (set the
Separation Code
to
NOT_HEAT_RESISTANT
).

DistanceWireProduct(EB.1\Wire.1 ,GB1.1\Muffler.1 )
returns the following value:
171.964mm

A check is defined as follows:

/*Check created by xxx 11/27/2007*/
(Object > HasAttribute('Zone') ) and
(Object > GetAttributeString('Zone')== 'HOT' and
mywire\Elec_Sep_Cod == 'NOT_HEAT_RESISTANT') =>
( DistanceWireProduct (mywire,Object)> 130.00mm)

Updating the session displays a status light on the check. A report is generated showing the check result: some wires verify the condition, other not.

Example 3

The DistanceWireProduct user function can be used in Knowledge Advisor to define a rule that displays a warning message if a minimum distance between a conductor and an object is smaller than a critical value chosen by the user.
if( DistanceWireProduct (EB.1\Wire.22 ,GB1.1\Muffler.1
)<Critical_Distance
and Muffler\Properties\Zone == "HOT" and 'EB1\Wire.22\Separation
Code'
== "NOT_HEAT_RESISTANT"
Message(" > WARNING: # is not heat-resistant and the minimum
distance with # is smaller than the critical distance #.
",'Wire.22\Part Number' , 'Muffler\PartNumber'
,Critical_Distance)

Running this rule displays the following message:

Rule.2: Information
WARNING: Wire.22 is not heat-resistant and the minimum distance
with Muffler is smaller than the critical distance
303.648mm.

Example 4

Still in Knowledge Advisor, an action can be defined using the DistanceWireProduct user function, to know the distance between a conductor and an object selected in the specification tree:

Inputs:

a: Wire, b: Product
Message("The distance between the wire '#' and the product
'#' is #.",
a.Name,b.Name, DistanceWireProduct(a,b) )

Run the action using the Action.1 contextual menu: select a conductor and a product in the specification tree then validate.

This message displays:

Action.1: Information
The distance between the wire 'Wire.1' and the product 'Muffler.1'
is 171.964mm.

Elec_BundleSegmentExtremities

The Elec_BundleSegmentExtremities user function can be used in Knowledge Expert.

Syntax

Elec_BundleSegmentExtremities Segment > Elec_BundleSegmentExtremities (SegmentExtremity: out SegmentEnd, SegmentExtremity: out SegmentEnd): Boolean Package: ElectricalFunctions

Elec_DistanceCommon

The Elec_DistanceCommon user function can be used in Knowledge Expert.

Syntax

Elec_DistanceCommon ((Wire1: Wire, Wire2: Wire):Length

Returns the common length of the two conductors given as input arguments. The type of Wire1 and Wire2 is

ElecWire.

Example 1

The Elec_DistanceCommon user function can be used in Knowledge Expert to find all the couples of conductors in the session that have a common length greater than a given value.
/*Rule created by xxx 11/27/2007*/
if(a>b) and Elec_DistanceCommon (a,b)> 400mm)
Message("# and # have a common length.
It is equal to
",a.Name,b.Name,round(Elec_DistanceCommon(a,b)*1000),"mm.")

Example 2

In Knowledge Advisor, it can be used to define a rule giving the common length of two specific conductors sharing properties.
/*Rule created by xxx 11/27/2007*/
if(Elec_DistanceCommon('Wire Harness1.1\Wire-check','Wire
Harness1.1\Wire-minus3')>400mm)
Message("The specified wires,
",'Wire_Harness1\Wire-check1\Reference_designator'," and
",'PN-AMP-3403B.2\Part_Number',",whose separation code is set to
Wet,
have a common length greater than 400mm: namely "
,(Elec_DistanceCommon('Wire Harness1.1\Wire-check1','Wire
Harness1.1\Wire-minus3')))
Applying the rule displays the following message if the condition is met:
The specified wires, Wire-check1 and PN-AMP-3403B.2, whose
separation code is set to Wet,
have a common length greater than 400 mm: namely 407.069mm

Example 3

Still in Knowledge Advisor, to verify that two conductors selected in the specification tree have a common length, the following action can be defined:
/**/
Message("The common length between # and # is equal to "
,a.Name,b.Name, Elec_DistanceCommon(a,b),".")
then select two conductors in the specification tree and click OK to validate.

The following message displays:

The common length between Wire-minus2 and Wire-check1 is
equal to 332.17mm.

ElectricalConnect

The ElectricalConnect user function can be used in Knowledge Expert. This function exposed on Device instance, used to connect two device instances.

Syntax

ElectricalConnect ((PLMProductInstanceDS DeviceInstance, String ConnectionPointName, PLMProductInstanceDS DeviceInstanceToConnectTo, String ToConnectionPointName)): Boolean

Example

 Dev1: PLMProductInstanceDS
 Dev2: PLMProductInstanceDS

 Let Dev1Name(STRING)
 Let Dev2Name(STRING)
 Let bConnected(Boolean)
 Dev1Name = Dev1.PLM_ExternalID
 Dev2Name = Dev2.PLM_ExternalID

 bConnected = ElectricalConnect (Dev1,"BackshellCnctPt.1",Dev2,"BackshellCnctPt.1")
 if(bConnected == true)
 {
    Message("Connected")
 }

ElectricalDisconnect

The ElectricalDisconnect user function can be used in Knowledge Expert. This function is exposed on Device instance, used to disconnect two device instances.

Syntax

ElectricalDisconnect (PLMProductInstanceDS DeviceInstance, String ConnectionPointName):Boolean

Example

 Dev1: PLMProductInstanceDS

 Let Dev1Name(STRING)
 Let bDisconnected(Boolean)
 Dev1Name = Dev1.PLM_ExternalID

 bDisconnected = ElectricalDisconnect (Dev1,"BackshellCnctPt.1")
 if(bDisconnected == true)
 {
    Message("Disconnected")
 }

FromTo

The FromTo user function can be used in Knowledge Expert.

Syntax

FromTo Wire > FromTo (From Product: out Product, FromConnectionPointName: out String, To Product: out Product, ToConnectionPointName: out String): Boolean Package: ElectricalFunctions

GetProtectionExtremities

The GetProtectionExtremities user function can be used in Knowledge Expert.

Syntax

GetProtectionExtremitiesProtection Covering > GetProtectionExtremities (ProtectionType: String, ProtectionExtremity1: out Point, ProtectionExtremity2: out Point): Boolean Package: ElectricalFunctions

InstanciateProtectionOnSegmentExtremity

The InstanciateProtectionOnSegmentExtremity user function can be used in Knowledge Expert.

Syntax

InstanciateProtectionOnSegmentExtremity(SegmentExtremity: SegmentEnd, ProtectionType: String, Length: Length, Protection: out Protection Covering): Boolean Package: ElectricalFunctions

ListAllOuterLayerObjects

The ListAllOuterLayerObjects user function can be used in Knowledge Expert.

Syntax

ListAllOuterLayerObjects(ElecBundleSegmentExtremity:Feature,Offset:Real,ListOfAllCoveringProducts(Protections/Supports):out List): Boolean

Returns an ordered list of protective coverings and supports that cover the segment at the point of interest. The point of interest is defined by specifying from which end of the segment and entering an offset in mm.

Example

A check (in KWE advanced language) to determine the protective coverings and supports at 150 mm from end 1 (Extremity 1) of the segment is written as follows:
mysegment:Segment
let ListCovering(List)
let ListCovered(List)
let return(Boolean)
let NbCovering(INTEGER)
let NbCovered(INTEGER)
let Offset(Real)
let CoveringObject(String)
let CoveredObject(String)
let i(INTEGER)
let Offset(Real)
let Extremity1(BundleSegmentExtremity)
let Extremity2(BundleSegmentExtremity)
Message("OBJECT = #",mysegment > Name())
mysegment.Elec_BundleSegmentExtremities(Extremity1,Extremity2)
Message("#### TEST ListAllOuterLayerObjects ####")
Offset = 150
return =
ListAllOuterLayerObjects(Extremity1,Offset,ListCovering)
NbCovering = ListCovering_>Size()
Message("Number of covering objects = "",NbCovering)
i = 1
for i while i<=NbCovering
{
CoveringObject = ListCovering > GetItem(i)
Message("Covering Object: #",CoveringObject)
}

ListDirectlyCoveredObjects

The ListDirectlyCoveredObjects user function can be used in Knowledge Expert.

Syntax

ListDirectlyCoveredObjects((Protection/Support):Feature, ListOfCoveredProducts(BundleSegments/Protections/Supports): out List): Boolean

Returns the list of segments, protective coverings and/or supports directly under the component (protective covering or support) you want to analyze. If the component you want to analyze is not a protective covering or a support, the list returned will be empty.

Example




  • Tape A is placed directly over the segment
  • Corrugated tubes B and C are linked to the segment, and corrugated tube B covers tube C
  • Standard support D is linked to the segment.

A check (in KWE advanced language) to determine the list of segments, protective coverings and supports under corrugated tube C is written as follows:

myprotection:Protection
let ListCovered(List)
let return(Boolean)
let NbCovered(INTEGER)
let Offset(Real)
let CoveredObject(String)
let i(INTEGER)
return = ListDirectlyCoveredObjects(mysegment,
ListCovered)
NbCovered = ListCovered > Size()
Message("Component analyzed: #",myprotection > Name())
Message("Number of objects covered = #",NbCovered)
i = 1
for i while i<=NbCovered{
CoveredObject = ListCovered > GetItem(i)
Message("Covered Object: #",CoveriedObject)
}
Running this check returns:


  • The name of the component analyzed, in our case, corrugated tube C
  • The number of objects covered by corrugated tube C:
    Information: Number of objects covered = 1
  • Followed by the name of this component: the segment.

ListDirectlyOuterLayerObjects

The ListDirectlyOuterLayerObjects user function can be used in Knowledge Expert.

Syntax

ListDirectlyCoveredObjects((BundleSegment/Protection/Support):Feature, ListOfCoveringProducts(Protections/Supports): out List): Boolean

Returns the list of outer layers of protective coverings and/or supports directly over the component (segment, protective covering or support) you want to analyze. If the component you want to analyze is not a segment, protective covering or a support, the list returned will be empty.

Example




  • Tape A is placed directly over the segment
  • Corrugated tubes B and C are linked to the segment, and corrugated tube B covers tube C
  • Standard support D is linked to the segment.

A check (in KWE advanced language) to determine the list of outer layers that directly cover the segment in the example is written as follows:

mysegment:Segment
let ListOuterLayer(List)
let return(Boolean)
let NbOuterLayer(INTEGER)
let Offset(Real)
let OuterLayerObject(String)
let i(INTEGER)
return = ListDirectlyOuterLayerObjects(mysegment,
ListOuterLayer)
NbOuterLayer = ListOuterLayer > Size()
Message("Component analyzed: #",mysegment > Name())
Message("Number of outer layers = #",NbOuterLayer)
i = 1
for i while i<=NbOuterLayer{
OuterLayerObject = ListOuterLayer > GetItem(i)
Message("Outer Layer: #",OuterLayerObject)
}
Running this check returns:
  • The name of the component analyzed, in our case, the segment.
  • The number of outer layers over the segment:
    Information: Number of outer layers = 3
    Only 3 are found because corrugated tube B does not directly cover the segment since it covers corrugated tube C.
  • Followed by the names of these components:
    Information Outer Layer: Tube_20x3-2004_10_27-10_01_49_842.1

ListElectricalConnectedObjects

The ListElectricalConnectedObjects user function can be used in Knowledge Expert. This function exposed on Device instances, used to get the List of connected objects with the device instance.

Syntax

ListElectricalConnectedObjects (in DeviceInstance: VPMInstance,

in ConnectionPointName: String,

out ListConnectedDevice: List, // list of connected devices

out List ConnectedConnectionPoint: List, // list of names of connected connection points

out ListConnectionActivity: List // New Argument, list of activities (boolean) of connections

):Boolean

New arguments

DeviceInstance - Input parent device instance

ConnectionPointName - Name of connection point to be analyzed

ListConnectedDevice - List of all devices connected to input device through input connection point

ListConnectedConnectionPoint - List of names of all connection points connected to input connection point

ListConnectionActivity - List of activity of connections in which input connection point is an element

All the output list will be one to one synchronized

Function Return (Boolean) - True if the analysis is successful, False otherwise.

Example

Common example for ListElectricalConnectionPointsNames and ListElectricalConnectedObjects. See below.

ListElectricalConnectionPointsNames

The ListElectricalConnectionPointsNames user function can be used in Knowledge Expert. This function is exposed on Device instances, used to get the List of connection point names and list of connection types in the device instance.

Syntax

ListElectricalConnectionPointsNames (PLMProductInstanceDS DeviceInstance, out List ListOfNames, out List ListOfTypes):Boolean

Example

Common example for ListElectricalConnectionPointsNames and ListElectricalConnectedObjects.

 Dev1: PLMProductInstanceDS

 let ListCxn(LIST)
 let ListCxnType(LIST)
 let ListConnectedDev(LIST)
 let ListConnectedCxnPtNames(LIST)
 let ListCxnActivity(LIST)
 let Size (Integer)
 let i(Integer)
 let iCxn(Integer)
 let sizeCxn(Integer)
 let Boolean(Boolean)
 let NewLine(STRING)
 let CxnName(STRING)
 let CxnType(STRING)
 let sMessage(STRING)
 let ConnectedDev(FEATURE)
 let ConnectedCxn(STRING)

 NewLine = ""
 sMessage = ""

 Boolean = ListElectricalConnectionPointsNames (Dev1, ListCxn, ListCxnType)
 if(Boolean == true)
 {
    sMessage = sMessage + " " + Dev1.PLM_ExternalID + NewLine

    Size = ListCxn->Size()
    if(Size == ListCxnType->Size())
    {
        sMessage = sMessage + "Number of connection Points = 
          " + ToString(Size) + NewLine
        i = 1
        for i while i<= Size
        {
            CxnName = ListCxn->GetItem(i)
            CxnType = ListCxnType->GetItem(i)
            Boolean = ListElectricalConnectedObjects  (Dev1,CxnName,  ListConnectedDev,
               ListConnectedCxnPtNames, ListCxnActivity)

            if(true == Boolean)
            {
                sizeCxn = ListConnectedDev->Size()
                if( (sizeCxn == ListConnectedCxnPtNames->Size()) AND (sizeCxn == ListCxnActivity->Size()) )
                {
                    sMessage = sMessage + ToString(i) + ": " + CxnName + " (" + CxnType + ")
                       Connected to - " + ConnectedDev.Name + " -> " + ConnectedCxn + NewLine
                    iCxn = 1
                    for iCxn while iCxn <= sizeCxn
                    {
                        set ConnectedDev = ListConnectedDev->GetItem(iCxn)
                        if(NULL <> ConnectedDev)
                        {
                             set ConnectedCxn = ListConnectedCxnPtNames->GetItem(iCxn)
                             bCxnActivity = ListCxnActivity->GetItem(iCxn)
                             if(true == bCxnActivity)
                                 sCxnActivity = "true"
                             else
                                 sCxnActivity = "false"
                             sMessage = sMessage + NewLine + ToString(iCxn) + ConnectedDev.Name + " -> " +
                             ConnectedCxn + "Activity" + sCxnActivity + NewLine
                        }
                    }
                    sMessage = sMessage + NewLine
                }
            }       
            else
                sMessage = sMessage + ToString(i) + ": " + CxnName + " (" + CxnType + ")
            Not Connected" + NewLine
       }
    }
    Message("#",sMessage)
 }

ListElectricalWires

The ListElectricalConnectionPointsNames user function can be used in Knowledge Expert. This function is exposed on Device instances, used to get the List of conductors connected to the device and list of connection point names with which wire is connected with the device instance.

Syntax

ListElectricalWires (PLMProductInstanceDS DeviceInstance, out List ListOfWires, out List ListOfNames):Boolean

Example

 SIC: PLMProductInstanceDS

 Let bln(Boolean)
 Let ListOfWires(List)
 Let ListCnctPtName(List)

 bln = ListElectricalWires (SIC,ListOfWires,ListCnctPtName)
 if(1==ListOfWires.Size())
 {
    Message("One wire connected to the input device")
 }

ListUsedSupports

The ListUsedSupports user function can be used in Knowledge Expert.

Syntax

ListUsedSupports(Segment: Segment, Supports: out List): Boolean Package: ElectricalFunctions)

Returns the list of supports through which a segment or electrical branch geometry is routed.

Example

The example shows an electrical branch geometry containing two segments, each routed through seven supports.

A rule (in KWE advanced language) to determine the number and names of the supports through which each segment is routed is written as follows:
bns : Segment
let SupportList(List)
let return(Boolean)
let i(INTEGER)
let UsedSupport(String)
let NbUsedSupports(INTEGER)
return = ListUsedSupports(bns, SupportList)
Message("Segment: #",bns > Name())
NbUsedSupports = SupportList > Size()
Message("No. Used Supports = #",NbUsedSupports)
i = 1
for i while i<=NbUsedSupports{
UsedSupport = SupportList > GetItem(i)
Message("Used Support: #",UsedSupport )
}
Solving this rule returns:
  • The name of the segment analyzed.
  • The number of supports through which the segment is routed.
    Information No. Used Supports = 7
    Only 3 are found because corrugated tube B does not directly cover the segment since it covers corrugated tube C.
  • Followed by the names of these supports.
    Information Used Support : Plastic-A.14

ListOuterLayerProtections

The ListOuterLayerProtections user function can be used in Knowledge Expert.

Syntax

ListUsedSupports((Point, Point: oListOfProtections:: Boolean (Point: Point, ListOfProtections: out List): Boolean Package: ElectricalFunctions)

Returns the list of protections from a point.

ListProtectionsFromExtremity

The ListProtectionsFromExtremity user function can be used in Knowledge Expert.

Syntax

ListProtectionsFromExtremity(Extremity: SegmentEnd, ListOfProtections: out List): Boolean Package: ElectricalFunctions

Returns the list of protections from a segment extremity.

ListProtectionsWithTotalLength

The ListProtectionsWithTotalLength user function can be used in Knowledge Expert.

Syntax

ListProtectionsWithTotalLength Harness Bundle > ListProtectionsWithTotalLength (ListOfProtection: out List, ListOfTotalLength: out List): Boolean Package: ElectricalFunctions

ListUsedSupportWithAbscissa

The ListUsedSupportWithAbscissa user function can be used in Knowledge Expert.

Syntax

ListUsedSupportWithAbscissa (iBundleSegment: Bundle Segment, oSupportList: List, oEntryPointAbscissa: List, oExitPointAbscissa; List): Boolean

Returns the list of supports in the order in which they are located along the center curve of the segment from the first end of the specified segment. Two other lists are output: entry point coordinates and exit point coordinates for each support.

Syntax

ListUsedSupportWithAbscissa (iBranchableBundle: Branchable Bundle Segment, oSupportList: List, oEntryPointAbscissa: List, oExitPointAbscissa; List): Boolean

Returns the list of supports in the order in which they are located along the center curve of the branch from the first end of the specified segment. Two other lists are output: entry point coordinates and exit point coordinates for each support.

Example

An expert rule (created using Knowledge Expert) to determine the list of all the supports located along all segments in the document that also outputs support entry and exit point coordinates:
bs:Branch
let SptList(List)
let inList(List)
let outList(List)
let ret(Boolean)
let i(INTEGER)
ret = ListUsedSupportsWithAbscissa (bs, SptList, outList,
inList)
Message("BS=",bs > Name())
i=1
for i while i<=(SptList > Size()){
Message("Abs In #, Abs Out #",outList > GetItem(i), inList >
GetItem(i))
}