AutomaticCableRouting
The function computes and specifies
the 3D network path of a list of cable routes. The business rules, routing
constraints, and segregation rules specified by you are considered in route
computation. Cable route validation and synchronization is the one specified in user
settings. The diameter of the segments is updated according to the cables routed
through the segments if the preference is selected.
Signature
AutomaticCableRouting (ListOfCableRoute: List, ListRoutingStatus: List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ListOfCableRoute |
In |
Yes |
List |
List of cable routes (ElecRoute) to be routed. |
ListRoutingStatus |
Out |
Yes |
List |
Route status for each cable route.
List contains values of RouteStatus.
= Routed if route could be found in 3D network.
= Not_Routed if not route could be found.
|
ReturnType
Boolean
The function returns TRUE if cable routing is successfully executed.
The function returns FALSE if the cable routing execution failed.
ConnectSegmentsDistantly
Signature
ConnectSegmentsDistantly(FromSegmentExtremity : SegmentExtremity, ParentResourceOcc : ProductOccurrence, ToPort : ElecPort) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
FromSegmentExtremity |
In |
|
SegmentExtremity |
- |
ParentResourceOcc |
In |
|
ProductOccurrence |
- |
ToPort |
In |
|
ElecPort |
- |
ConnectSegmentsDistantly
Signature
ConnectSegmentsDistantly(FromSegmentExtremity : SegmentExtremity, ToSegmentExtremity : SegmentExtremity) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
FromSegmentExtremity |
In |
|
SegmentExtremity |
- |
ToSegmentExtremity |
In |
|
SegmentExtremity |
- |
CreateAdvancedConnectionPoint
You can use this function in Quality Rules Reuse.
Signature
CreateAdvancedConnectionPoint(DeviceReference : VPMReference, TypeOfConnectionPt : String, ListOfGeometries : List [, NameOfCnctPt : String]) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
DeviceReference
|
In |
Yes |
VPM Reference |
Device reference in which the connection point
is to be created. |
TypeOfConnectionPt
|
In |
Yes |
String
|
A type of connection point to be created. Only
the following strings can be used to create the type of
connection points:
- "Cavity"
- "CavityConnectionPoint"
- "ConnectorConnectionPoint"
- "BackshellConnectionPoint"
- "ShellConnectionPoint"
- "SegmentConnectionPoint"
- "SegmentPositionPoint"
|
ListOfGeometries
|
In |
Yes |
List
|
List of geometries to be set as joint
parameter of advanced electrical connection points. The list
should not contain NULL or empty element in intermediate
positions. It can have up to four elements (depending on the
type of connection points being created) respectively for:
Representation
Contact /Point for segment connection
point
Coincidence / Tangency for segment connection
point
Orientation
Representation and contact are mandatory arguments.
|
NameOfCnctPt
|
In |
Optional |
String
|
Optional argument. The name of the connection
point yet to create. If the argument is not passed, the
connection point is created with a default name. |
ReturnType
Boolean
This is the return value from the function which indicates the result of
execution.
TRUE: Only if the connection point is successfully created.
FALSE: If the connection point creation fails, the reasons of function failure
can be:
- The input VPMReference is not a device; means it does not have an
electrical extension.
- The connection point type input is not allowed or compatible with input
device reference.
- The geometries are already published as connection points.
Example
You can create and execute the following rule. The rule creates a segment
connection point using the advanced connection point method on a single insert
connector reference.
DevInst : VPMReference
Let index (INTEGER)
Let size (INTEGER)
Let sMessgae (STRING)
Let sName (STRING)
Let result (Boolean)
Let plane (Plane)
Let point (Point)
Let ListObjects (LIST)
Let ListGeometries (LIST)
set sName = ""
/* Find the Point*\
ListObjects = DevInst->Query("Point", "")
index = 1
size = ListObjects.Size()
for index while index <= size
{
set point = ListObjects->GetItem(index)
if(NULL <> point)
{
set sName = point.Name
if(sName == "Point.2")
{
ListGeometries.Append(point) /* For representation */
ListGeometries.Append(point) /* For Contact */
set size = 0
}
}
}
/* Find the plane */
index = 1
ListObjects.RemoveAll()
ListObjects = DevInst->Query("Plane", "")
for index while index <= ListObjects.Size()
{
set plane = ListObjects->GetItem(index)
if(NULL <> plane)
{
set sName = plane .Name
if (sName == "Plane.1")
{
ListGeometries.Append(plane ) /* For Tangency */
}
}
}
/* Create the connection point */
result = CreateAdvancedConnectionPoint(DevInst, "SegmentConnectionPoint", ListGeometries)
if (result == true) Message("Advance connection Point created successfully")
CreateBranch
The CreateBranch function allows adding a new branch in an existing branch
geometry.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
ElectricalBranchGeometry
|
Input |
Yes |
ElectricalBranchGeometryOccurrence |
The electrical geometry under which the new
branch is added. |
ListOfRouteElements
|
Input |
Yes |
List |
The list of the Elec3DRouteElements
defining the route of the new branch. |
NewBranch
|
Output |
Yes |
Branch |
The new branch is routed through the route
elements of the list. |
ReturnType
Boolean
The method returns FALSE if the branch is not created.
CreateBranchOnExternalCurve
Signature
CreateBranchOnExternalCurve(ElectricalBranchGeometry : ElectricalBranchGeometryOccurrence, ExternalCurvePartOcc : ProductOccurrence, ExternalCurve : Feature, NewBranch : Branch) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ElectricalBranchGeometry |
In |
|
ElectricalBranchGeometryOccurrence |
- |
ExternalCurvePartOcc |
In |
|
ProductOccurrence |
- |
ExternalCurve |
In |
|
Feature |
- |
NewBranch |
Out |
|
Branch |
- |
CreateCircularProfile
You can use this function to define a Circle type profile on a
branch.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Diameter
|
Input |
Yes |
LENGTH |
The diameter of the circle. |
NewProfile
|
Output |
Yes |
ElecCircularProfile
|
The new profile with its type and dimensions
set as input. |
ReturnType
Boolean
The method returns FALSE if the profile is not set correctly.
CreateDeviceDistantLink
You can use this function to
create
a distant link between a device and a branch/branch point. If the input is a branch,
then the created link is the shortest link from the device center/device cavity to
this branch. If the input is a branch point, then the link is created from the
device center/cavity to this branch
point.
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
FromBranch |
In |
Yes |
Feature |
Branch or branch point with which a distant
link is to be created. |
ToDeviceOccurrence |
In |
Yes |
ProductOccurrence |
The device occurrence to connect the input
branch distantly with. |
ToCavity |
In |
Yes |
Elec3DCavity |
Cavity of the device occurrence to link with
the branch. This input can be NULL. |
NewDistantLink |
Out |
Yes |
ElecDeviceDistantLink |
Newly created distant branch link
feature. |
ReturnType
Boolean
The function returns TRUE if the distant link is created.
The function returns FALSE if the distant link is not created.
CreateDeviceRouteElement
The CreateDeviceRouteElement function allows adding a new device to a branch's
route.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Device
|
Input |
Yes |
ProductOccurence |
- |
ConnectionPoint
|
Input |
Yes |
ElecPort |
The type can be:
- Elec3DSegmentConnectionPoint
- Elec3DCavity
- Elec3DCavityV5
- Elec3DSegmentConnectionPointV5
|
NewElecDeviceRouteElement
|
Output |
Yes |
Elec3DDeviceRouteElement
|
The new device added to the branch route.
|
ReturnType
Boolean
The method returns FALSE if the device is not defined properly.
CreateElecGuideCurve
Signature
CreateElecGuideCurve(Elec3DDuct : Elec3DDuct, GeometricFeature : GeometricFeature, Elec3DGuideCurve : Elec3DGuideCurve) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Elec3DDuct |
In |
|
Elec3DDuct |
Duct reference in which the electrical guide
curve is to be created. |
GeometricFeature |
In |
|
GeometricFeature |
Line or spline to be published and set as the
reference of the Elec3DGuideCurve. |
Elec3DGuideCurve |
Out |
|
Elec3DGuideCurve |
Output Elec3DGuideCurve created. |
ReturnType
Boolean
This is the return value from the function which indicates the result of
execution.
TRUE: Only if the electrical guide curve is successfully created.
FALSE: If the electrical guide curve creation fails. The reasons of function
failure can be:
- The geometries are already published as electrical guide curve.
- The geometry is not inside the duct representation.
- The duct is not editable.
CreateEllipticalProfile
The CreateEllipticalProfile function allows defining a profile of Ellipse type on
a branch.
Signature
CreateEllipticalProfile(MajorAxis : LENGTH, MinorAxis : LENGTH, NewProfile : ElecEllipticalProfile) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
MajorAxis
|
Input |
Yes |
LENGTH |
The major axis of the ellipse. |
MinorAxis
|
Input |
Yes |
LENGTH |
The minor axis of the ellipse. |
NewEllipticalProfile
|
Output |
Yes |
ElecEllipticalProfile
|
The new profile with its type and dimensions
set as input. |
ReturnType
Boolean
The method returns FALSE if the profile is not set correctly.
CreateExtensionGuideCurve
Signature
CreateExtensionGuideCurve(ElectricalBranchGeometry : ElectricalBranchGeometry, GeometricFeature : GeometricFeature, Elec3DExtensionGuideCurve : Elec3DExtensionGuideCurve) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ElectricalBranchGeometry |
In |
|
ElectricalBranchGeometry |
EBG in which the electrical guide curve is to
be created. |
GeometricFeature |
In |
|
GeometricFeature |
Line or spline to be extended to the
Elec3DExtensionGuideCurve. |
Elec3DExtensionGuideCurve |
Out |
|
Elec3DExtensionGuideCurve |
The Elec3DExtensionGuideCurve to be
created. |
ReturnType
Boolean
This is the return value from the function which indicates the result of
execution.
TRUE: Only if the electrical guide curve is successfully created.
FALSE: If the electrical guide curve creation fails, the reasons of function
failure can be:
- The geometry is not inside the Electrical Branch Geometry
representation.
- The Electrical Branch of Geometry is not editable.
- The curve is not a line or a spline.
CreatePath
The CreatePath function allows creating a network path based on a list of
connected segments.
Signature
CreatePath(ListPathElements : List, NetworkPath : Elec3DNetworkPath) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
iListPathObjects
|
Input |
Yes |
List |
List of connected segments |
o3DNetworkPath
|
Output |
Yes |
Elec3DNetworkPath
|
The network path |
ReturnType
Integer
The method returns FALSE if the creation fails.
Example
The following sample illustrates how to create a network path based on a list of
segments.
// create path from the selected segments
let ListInputElem(List)
let myRoutePath(Elec3DNetworkPath)
Notify( "path element 1 : ",SGT1.Name)
Notify( "path element 2 : ",SGT2.Name)
Notify( "path element 3 : ",SGT3.Name)
Notify( "path element 4 : ",SGT4.Name)
ListInputElem.AddItem(SGT1,1)
ListInputElem.AddItem(SGT2,2)
ListInputElem.AddItem(SGT3,3)
ListInputElem.AddItem(SGT4,4)
CreatePath(ListInputElem,myRoutePath)
// reset graph
ResetElectricalNetworkGraph()
CreatePointRouteElement
The CreatePointRouteElement function allows adding a new point to a branch's
route.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
InputPoint
|
Input |
Yes |
Feature |
A point, a branch point, or a segment
extremity. |
NewElecPointRouteElement
|
Output |
Yes |
Elec3DPointRouteElement
|
The new point is added to the branch route.
|
ReturnType
Boolean
The method returns FALSE if the route point is not defined properly.
CreatePointRouteElementWithTangency
The
CreatePointRouteElementWithTangency function allows adding a new point with tangency to
a branch's route.
Signature
CreatePointRouteElementWithTangency(iPoint : Feature, iTangent : Feature,iOrientation : ElecTangentOrientation, iProductContext : ProductOccurrence, oRouteElement : Elec3DPointRouteElement) : Boolean
Arguments
Note:
An argument is nullable means that it can take or receive NULL as
value.
| Name |
Input / Output |
Nullable |
Type |
Comment |
iPoint
|
Input |
No |
Feature |
Can be:
- Point
- Branch point
- Segment extremity
This is the point on which you can create the route
element. |
iTangent
|
Input |
No |
Feature
|
Can be:
- Vector
- Geometrical object like splines, lines and
planes
This is the tangency on branch’s curve of
iPoint. |
iOrientation
|
Input |
No |
ElecTangentOrientation |
“Orientation_Direct” or “Orientation_Inverted”
|
iProductContext
|
Input |
Yes |
ProductOccurrence |
If the tangent is a vector, this argument is
ignored and should be NULL. If the tangent is a geometrical
object, this argument must be the product to which the
geometrical object belongs. It ensures the correct external
reference is created when adding the tangent during branch
creation. If NULL, the first occurrence of the
geometrical object’s parent reference is used, which may not
be the expected one. For best results, always set a value
for this argument. If set incorrectly, no tangent is
added at this point when the branch is created. |
oRouteElement
|
Output |
If this function call fails. |
Elec3DPointRouteElement |
The output which is a PointRouteElement that you
can use to create and route a branch.
|
ReturnType
Boolean
True if the point route element is created, False otherwise.
CreateRectangularProfile
The CreateRectangularProfile function allows defining a profile of rectangular
type on a branch.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Width
|
Input |
Yes |
LENGTH |
The width of the rectangle. |
Height
|
Input |
Yes |
LENGTH |
The height of the rectangle. |
NewProfile
|
Output |
Yes |
ElecRectangularProfile
|
The new profile with its type and dimensions
set as input. |
ReturnType
Boolean
The method returns FALSE if the profile is not set correctly.
CreateReplicatedPublication
Signature
CreateReplicatedPublication(DeviceAssembly : VPMReference, PublicationName : String, DeviceOccurrence : ProductOccurrence, Publication : ElecPort, ReplicatedPublication : ElecPort) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
DeviceAssembly |
In |
|
VPMReference |
The assembly device on which the publication
is replicated. |
PublicationName |
In |
|
String |
Name of the replicated publication. |
DeviceOccurrence |
In |
|
ProductOccurrence |
Sub-Component of the assembly device. |
Publication |
In |
|
ElecPort |
Publication to replicate. |
ReplicatedPublication |
In |
|
ElecPort |
Replicated publication. |
CreateStandardConnectionPoint
The CreateStandardConnectionPoint user function can be used in Quality Rules Reuse.
Signature
CreateStandardConnectionPoint(DeviceReference : VPMReference, TypeOfConnectionPt : String, AxisSystem : AxisSystem, NameOfCnctPt : String) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
DeviceReference
|
In |
Yes |
VPM Reference |
Device reference in which the connection point
is to be created. |
TypeOfConnectionPt
|
In |
Yes |
String
|
A type of connection point to be created. Only
the following strings can be used to create the type of
connection points:
- "Cavity"
- "CavityConnectionPoint"
- "ConnectorConnectionPoint"
- "BackshellConnectionPoint"
- "ShellConnectionPoint"
- "SegmentConnectionPoint"
- "SegmentPositionPoint"
|
AxisSystem
|
In |
Yes |
AxisSystem |
To be set as the representation of the
standard electrical connection point. |
NameOfCnctPt
|
In |
Yes |
String
|
Optional argument. The name of the connection
point yet to create. If the argument is not passed, the
connection point is created with a default name. |
ReturnType
Boolean
This is the return value from the function which indicates the result of
execution.
TRUE: Only if the connection point is successfully created.
FALSE: If the connection point creation fails. The reasons of function failure
can be:
- The input VPMReference is not a device, means it does not have an
electrical extension.
- The connection point type input is not allowed or compatible with input
device reference.
- The geometries are already published as connection points.
Example
You can create and execute the following rule. This rule creates a cavity using
the CreateStandardConnectionPoint function on a single insert connector
reference. DevInst : VPMReference
Let Ref(VPMReference)
Let Axis (AxisSystem)
Let ListAxis (List)
Let index (INTEGER)
Let size (INTEGER)
Let sName (STRING)
Let result (Boolean)
set index = 1
ListAxis = DevInst->Query("AxisSystem", "")
for index while index <= ListAxis.Size()
{
set Axis = ListAxis->GetItem(index)
if(NULL <>Axis)
{
set sName =Axis.Name
if(0 == sName.Search("Cavity"))
{
result = CreateStandardConnectionPoint(Ref, "Cavity", Axis)
if(result == false)
Message = "Standard Connection Point created successfully"
}
}
}
}
CreateStandardConnectionPoint
- The corresponding standard connection point is created from advanced connection
point data.
- The attributes are copied
- The advanced connection point deletion is optional
- The naming of the created connection point can be managed by user.
Signature
CreateStandardConnectionPoint (iAdvancedCnctPt:ElecPortV5, iNewConnectionPointName:string, bDeletedAdvancedCnctpt:Boolean, oNewStandardCnctPt:ElecPort ) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
iAvancedCnctPt
|
In |
Yes |
ElecPortV5 |
Any type of supported of advanced connection point
- Elec3DCavityV5
- Elec3DConnectorConnectionPointV5
- Elec3DBackShellConnectionPointV5
- Elec3DShellConnectionPointV5
- Elec3DSegmentConnectionPointV5
- Elec3DCavityConnectionPointV5
|
iNewConnectionPointName
|
In |
Yes |
String
|
Name of new connection point. Warning: the name must be
different from the advanced connection name if the deletion
of advanced connection point is not requested. |
bDeletedAdvancedCnctpt
|
In |
Yes |
Boolean |
= true: advanced connection point deleted (if creation
successful) = false: keep advanced connection
point |
oNewStandardCnctPt
|
Out |
Yes |
ElecPort |
The corresponding standard connection point:
- Elec3DCavity
- Elec3DConnectorConnectionPoint
- Elec3DBackShellConnectionPoint
- Elec3DShellConnectionPoint
- Elec3DSegmentConnectionPoint
- Elec3DCavityConnectionPoint
|
ReturnType
Boolean
The function returns TRUE if the standard connection point is correctly
created.
The function returns FALSE if the creation fails or deletion fails.
The function may fails if the advanced connection point is not deleted and if the
number of creations of connection point of the same type has been reached.
CreateSupportRouteElement
The CreateSupportRouteElement function allows adding a new support to a branch's
route.
Signature
CreateSupportRouteElement(Support : ProductOccurrence, IndexOfSection : Integer, NewElecSupportRouteElement : Elec3DSupportRouteElement) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Support
|
Input |
Yes |
ProductOccurence |
- |
IndexOfSection
|
Input |
Yes |
Integer |
- |
NewElecDeviceRouteElement
|
Output |
Yes |
Elec3DSupportRouteElement
|
The new support is added to the branch route.
|
ReturnType
Boolean
The method returns FALSE if the support is not defined properly.
CreateTruncatedRectangularProfile
The CreateTruncatedRectangularProfile function allows defining a profile of
truncated rectangle type on a branch.
Signature
CreateRectangleProfile(MajorHeight : Length, MajorWidth : Length, MinorHeight : Length, MinorWidth : LENGTH, CornerPosition : string, NewProfile : ElecTruncatedRectangularProfile) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
MajorWidth
|
Input |
Yes |
LENGTH |
The major width of the rectangle. |
MajorHeight
|
Input |
Yes |
LENGTH |
The major height of the rectangle. |
MinorWidth
|
Input |
Yes |
LENGTH |
The minor width of the rectangle. |
MinorHeight
|
Input |
Yes |
LENGTH |
The minor height width of the rectangle.
|
CornerPosition
|
Input |
Yes |
String |
The corner position: top-left, top-right,
bottom left, or bottom right. |
NewTruncatedRectangularProfile
|
Output |
Yes |
ElecTruncatedRectangularProfile
|
The new profile with its type and dimensions
set as input. |
ReturnType
Boolean
The method returns FALSE if the profile is not set correctly.
DistanceWireProduct
The DistanceWireProduct user function can be used in Quality Rules Reuse.
Signature
DistanceWireProduct(Wire : Feature, Object : Feature) : LENGTH
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Wire
|
In |
Yes |
Feature
|
None |
Object
|
In |
Yes |
Feature
|
Object can be:
- A product instance (for example, a device instance)
- A geometric feature (for example, a point)
|
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 Quality Rules Reuse 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 wires (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 do not.
Example 3
The DistanceWireProduct user function can be used in Engineering Rules Capture to define a rule that displays a warning message if a minimum distance
between a wire and an object is smaller than a critical value defined 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 Engineering Rules Capture, an action can be defined using the DistanceWireProduct user function, to
know the distance between a wire and an object selected in the tree. 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 Shortcut Menu: select a wire and a product in the tree, and then validate.
Running this rule displays the following message:
Action.1: Information
The distance between the wire 'Wire.1' and the product 'Muffler.1' is 171.964mm
Elec_DistanceCommon
The Elec_DistanceCommon user function can be used in Quality Rules Reuse.
Signature
Elec_DistanceCommon(FirstWire : Feature, SecondWire : Feature) : LENGTH
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
FirstWire
|
In |
Yes |
Feature
|
None |
SecondWire
|
In |
Yes |
Feature
|
None |
Example
The Elec_DistanceCommon user function can be used in Quality Rules Reuse to find all the couples of wires 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 Engineering Rules Capture, it can be used to define a rule giving the common length of two specific
wires 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 Engineering Rules Capture, to verify that two wires selected in the 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),".")
Select two wires in the tree and click OK to validate.
Running this rule displays the following message:
The common length between Wire-minus2 and Wire-check1 is equal to 332.17mm.
ElectricalConnect
The ElectricalConnect function is used to connect two device
occurrences, or also a splice occurrence with branch geometry occurrence. (Port-port
connection)
Signature
ElectricalConnect(iDeviceOccurence : ProductOccurrence, iElecPort : ElecPort, iToDeviceOccurence : ProductOccurrence, iToElecPort : ElecPort, [AllowMultipleConnections : Int]) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
iDeviceOccurence
|
In |
Yes |
ProductOccurrence |
None |
iElecPort
|
In |
Yes |
ElecPort |
None |
iToDeviceOccurence
|
In |
Yes |
ProductOccurrence |
None |
iToElecPort
|
In |
Yes |
ElecPort |
None |
AllowMultipleConnections |
In |
No |
Integer |
- 0: No (Default)
- 1: Yes
- 2: Follow Preferences
|
ReturnType
Boolean
Fail if the two devices could not be connected.
Succeed if the two devices are now connected.
Example
/* Connection of devices */
/* Declaration */
let ConnectorConnectionPoint1 (ElecPort)
let ConnectorConnectionPoint2 (ElecPort)
let Dev1Ref (Elec3DSingleInsertConnector)
let Dev2Ref (Elec3DSingleInsertConnector)
let LElecPortType(list)
let LConnectorConnectionPoint1(list)
let LConnectorConnectionPoint2(list)
LElecPortType.Append("Elec3DConnectorConnectionPoint")
// Retrieve the connector connection point 1
set Dev1Ref=Dev1.Reference
ListElectricalConnectionPoints(Dev1Ref,LElecPortType,LConnectorConnectionPoint1)
set ConnectorConnectionPoint1 = LConnectorConnectionPoint1->GetItem(1)
// Retrieve the connector connection point 2
set Dev2Ref=Dev2.Reference
ListElectricalConnectionPoints(Dev2Ref,LElecPortType,LConnectorConnectionPoint2)
set ConnectorConnectionPoint2 = LConnectorConnectionPoint2->GetItem(1)
// Connect
let bconnected(Boolean)
bconnected = ElectricalConnect(Dev1, ConnectorConnectionPoint1, Dev2, ConnectorConnectionPoint2, 0)
if (bconnected == true)
{
Message(“Devices connected together”)
}
ElectricalConnect
The ElectricalConnect function is used to connect two device
occurrences, or also a splice occurrence with branch geometry
occurrence.
Signature
ElectricalConnect(iDeviceOccurence : ProductOccurrence, iToDeviceOccurence : ProductOccurrence, iToElecPort : ElecPort, [AllowMultipleConnections : Int]) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
iDeviceOccurence
|
In |
Yes |
ProductOccurrence |
None |
iToDeviceOccurence
|
In |
Yes |
ProductOccurrence |
None |
iToElecPort
|
In |
Yes |
ElecPort |
None |
AllowMultipleConnections |
In |
No |
Integer |
- 0: No (Default)
- 1: Yes
- 2: Follow Preferences
|
ReturnType
Boolean
Fail if the two devices could not be connected.
Succeed if the two devices are now connected.
Example
/* Connection of devices */
/* Arguments */
/* Dev1 : ProductOccurrence, select a seal */
/* Dev2 : ProductOccurrence, select a SIC */
/* Declaration */
let Dev1Ref (Elec3DSingleInsertConnector)
let LElecPortType(list)
LElecPortType.Append("Elec3DCavity")
let LCavities(list)
let Cavity1 (ElecPort)
// Retrieve the cavity of the connector
set Dev1Ref=Dev1.Reference
ListElectricalConnectionPoints(Dev1Ref,LElecPortType,LElecPortType)
set Cavity1 = LElecPortType->GetItem(1)
// Connect
let bconnected(Boolean)
bconnected = ElectricalConnect(Dev1, Dev2, Cavity1, 0)
if (bconnected == true)
{
Message(“Devices connected together”)
}
ElectricalDisconnect
The ElectricalDisconnect function is exposed on a device occurrence and is
used to disconnect a given occurrence or all connected devices on the port if
nothing is given.
Signature
ElectricalDisconnect(iDeviceOccurrence : ProductOccurrence, iElecPort : ElecPort, iDeviceOccurrenceToRemove : ProductOccurrence) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
iDeviceOccurence
|
In |
Yes |
ProductOccurrence |
None |
iElecport
|
In |
Yes |
ElecPort |
None |
iDeviceOccurrenceToRemove |
In |
No |
ProductOccurrence |
If this variable is not provided, then all
devices are disconnected from the port |
ReturnType
Boolean
Fail if it is impossible to disconnect the devices.
Succeed if this is possible to disconnect it.
Example
/* Disconnection of devices */
/* Declaration */
let ConnectorConnectionPoint1 (ElecPort)
let Dev1Ref (Elec3DSingleInsertConnector)
let LElecPortType(list)
let LConnectorConnectionPoint(list)
// Retrieve the connector connection point
set Dev1Ref=Dev1.Reference
LElecPortType.Append("Elec3DConnectorConnectionPoint")
ListElectricalConnectionPoints(Dev1Ref,LElecPortType,LConnectorConnectionPoint)
set ConnectorConnectionPoint1 = LConnectorConnectionPoint->GetItem(1)
// disconnect
let bdisconnected(Boolean)
bdisconnected =ElectricalDisconnect(Dev1, ConnectorConnectionPoint1)
if (bdisconnected == true)
{
Message(“Devices disconnected”)
}
ElectricalDisconnectBranch
The ElectricalDisconnectBranch function is exposed on a device instance. It
can be used to disconnect electrically and geometrically branches connected to an
electrical device. The branch shape is not modified by the function.
Signature
ElectricalDisconnect(DeviceInstance : VPMInstance, ConnectionPointName : String) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
DeviceInstance
|
In |
Yes |
VPMInstance |
None |
ConnectionPointName
|
In |
Optional |
String
|
If the connection point name is not set: all
the branches are disconnected. |
ReturnType
Boolean
This is the return value from the function which indicates the result of
execution.
TRUE: if the disconnection is successfully performed.
FALSE: if the disconnection fails.
Example 1
Device: PLMProductInstanceDS
/* disconnect all branches */
Let bDisconnected(Boolean)
bDisconnected = ElectricalDisconnectBranch (Device)
if(bDisconnected == true)
{
Message("Disconnected")
}
Example 2
Device: PLMProductInstanceDS
/* disconnect branch connected at a specific connection point */
Let ConnectionPointID(STRING)
Let bDisconnected(Boolean)
ConnectionPointID =”SegmentCnct.1”
bDisconnected = ElectricalDisconnectBranch ( Device, ConnectionPointID )
if(bDisconnected == true)
{
Message("Disconnected")
}
GetConnectedArcs
This function retrieves all the nodes (and their associated arcs) connected
to a specific electrical port of a device occurrence.
A device node is computed on an electrical port only if the device electrical port is
connected to the branch extremities.
Signature
GetConnectedArcs(iDeviceOccurrence : ProductOccurrence, iElecPort : VPMPort, oConnectedNode : Elec3DDeviceNode, oListConnectedArcs : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
| iDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Input device occurrence. |
| iElecPort |
In |
Yes |
VPMPort |
Input an electrical device port. |
| oConnectedNode |
Out |
Yes |
Elec3DDeviceNode |
The node corresponds to segment extremities
connected to the device electrical port. |
| oListConnectedArcs |
Out |
Yes |
List |
The arcs connected to the exposed node.
|
ReturnType
Boolean
The function returns FALSE if:
- The input occurrence is not an electrical device occurrence.
- The input electrical port is not valid:
- The port has not the right type.
- The port is not connected to the input device occurrence.
- The search for segment extremities connected to port fails.
Example
The following sample illustrates how to retrieve the node and arcs connected to
the segment connection point of a connector occurrence.
For each arc retrieved as output in the arcs list, the CreateBranch method is used to
retrieve the associated segment.
/* Retrieve not connected segment connection point of a selected device */
let index(Integer)
let ConnectorRef(Elec3DSingleInsertConnector)
let BCP(Elec3DSegmentConnectionPoint)
let BCPNode(Elec3DDeviceNode)
let ListNetworkArc(List)
let nb_arc(Integer)
let i_arc(Integer)
let NetworkArc(Elec3DNetworkArc)
let ArcFeature(Feature)
let ArcSegment(Segment)
let ArcBranch(Branch)
let LElecPortType(List)
let LSegmentConnectionPoint(List)
let nb_bcp(Integer)
let nb_connected(Integer)
set ConnectorRef=myConnectorOcc.Reference
LElecPortType.Append("Elec3DSegmentConnectionPoint")
ListElectricalConnectionPoints(ConnectorRef,LElecPortType,LSegmentConnectionPoint)
nb_bcp=LSegmentConnectionPoint.Size()
nb_connected=0
index=1
for index while index <= nb_bcp
{
set BCP = LSegmentConnectionPoint->GetItem(index)
GetConnectedArcs(myConnectorOcc,BCP,BCPNode, ListNetworkArc)
if ( BCPNode == NULL) // not connected
{
// notify segment connection point status : not connected
Notify ( BCP.V_FunctionalName," is not connected to branch ")
}
else // connected
{
nb_connected = nb_connected + 1
// --- number of arc connected node
nb_arc = ListNetworkArc.Size()
i_arc=1
for i_arc while i_arc <= nb_arc
{
set NetworkArc = ListNetworkArc->GetItem(i_arc)
// retrieve the arc component : a segment
NetworkArc.GetComponent(ArcFeature)
set ArcSegment=ArcFeature
// retireve the branch from segment
set ArcBranch=ArcSegment.Owner
// notify segment connection status point : connected
Notify ( BCP.V_FunctionalName, " connected to ",ArcBranch.Name,"/",ArcFeature.Name)
}
}
index = index+1
}
// display the status
if ( nb_bcp == nb_connected ) Message ( " ok : all segment connection points are connected to branch " )
else Message ( " warning : segment connection points not connected to branch " )
GetConnectedDevice
This function retrieves the device connected to a specific electrical port of
a device occurrence.
Signature
GetConnectedDevice(iDeviceOccurrence : ProductOccurrence, iElectricalPort : VPMPort, oConnectedOccurrence : ProductOccurrence, oConnectedPort : VPMPort) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
| iDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Input device occurrence |
| iElectricalPort |
In |
Yes |
VPMPort |
List of electrical ports belonging to the
current device reference. |
| oConnectedOccurrence |
Out |
Yes |
ProductOccurence |
The connected device occurrence. The
element may be a device occurrence or a NULL object if no
device is connected to the corresponding port.
|
| oConnectedPort |
Out |
Yes |
VPMPort |
The connected electrical port. The element
may be an electrical port or a NULL object if no device is
connected to the input port.
|
ReturnType
Boolean
The function returns FALSE if:
- Input occurrence is not an electrical device occurrence.
- Any input port is not an electrical port.
- The search for connection fails.
Example
The following sample illustrates how to retrieve a device connected to the cavity
connection point of a connector.
/* check single insert connector not plugged into cavity */
/* input : iSingleConnectorOcc Elec3DSingleInsertConnectorOccurrence */
let LElecPortType(List)
let iSingleConnectorRef(Elec3DSingleInsertConnector)
let LCavityCnctPt(List)
let nb_cavity_cnctpt(Integer)
let CavityCnctpt(Elec3DCavityConnectionPoint)
let ElecConnectedDeviceOcc(ProductOccurrence)
let ConnectedCavity(VPMPort)
set iSingleConnectorRef=iSingleConnectorOcc.Reference
/* retrieve cavity connection point on connector reference */
LElecPortType.Append("Elec3DCavityConnectionPoint")
ListElectricalConnectionPoints(iSingleConnectorRef,LElecPortType,LCavityCnctPt)
nb_cavity_cnctpt=LCavityCnctPt.Size()
if ( nb_cavity_cnctpt == 1 ) set CavityCnctpt = LCavityCnctPt->GetItem(1)
/* retrieve device connector to cavity connection point of sincle connector */
GetConnectedDevice(iSingleConnectorOcc,CavityCnctpt,ElecConnectedDeviceOcc,ConnectedCavity)
if ( ElecConnectedDeviceOcc == NULL )
{
Message(" Connector : ",iSingleConnectorOcc.Name," is not plugged")
}
else Notify ( " Connector : ",iSingleConnectorOcc.Name," is plugged")
GetConnectedDevices
This function retrieves the devices connected to a specific electrical
port of a device occurrence.
Signature
GetConnectedDevices(ElectricalDeviceOccurrence : ProductOccurrence, ElectricalConnectionPoint : VPMPort, ConnectedDevices : List, ConnectedConnectionPoints : List) : Boolean
GetConnectedDevices(iDeviceOccurrence : ProductOccurrence, oListConnectedOccurrence : List, oListConnectedPort : List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
iDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Input device occurrence. |
iElectricalPort |
In |
Yes |
VPMPort |
Electrical port belonging to the current
device reference. |
OListConnectedDevices |
Out |
Yes |
List |
List
of the connected device occurrences. Element of list may be a
device occurrence or a NULL object if no device is connected to
the corresponding input port. |
oListConnectedPorts |
Out |
Yes |
List |
List
of the connected electrical ports of the connected device.
Element of list may be an electrical port or a NULL object if no
device is connected to the port. |
ReturnType
Boolean
The function returns FALSE if:
- Input occurrence is not an electrical device occurrence.
- Any input port is not an electrical port.
- The search for connection fails.
Example
// List all devices on all cavities
/* input : DeviceOccurrence ProductOccurrence */
let DeviceRef(VPMReference)
DeviceRef = DeviceOccurrence.Reference
// Retrieve all the cavities of the device
let LElecPortType(List)
LElecPortType.Append("Elec3DCavity")
let ListPorts(List)
ListElectricalConnectionPoints(DeviceRef, LElecPortType, ListPorts)
let port(VPMPort)
for port inside ListPorts
{
let LConnectedDevices(List)
let LConnectedPorts(List)
GetConnectedDevices(DeviceOccurrence,port,LConnectedDevices,LConnectedPorts)
let device(ProductOccurrence)
for device inside LConnectedDevices
{
Notify ( " Device : ",device.Name," is connected")
}
}
GetClockingAngle
This function retrieves the device clocking information.
Signature
GetClockingAngle(iPrimaryDevice : ProductOccurrence, iPrimaryPort : VPMPort, iSecondaryDevice : ProductOccurrence, iSecondaryPort : VPMPort, oClockingAngle : Angle, oClockingBehaviour : string, oClockingStatus : string) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
iPrimaryDevice |
In |
Yes |
ProductOccurrence |
Primary device occurrence. |
iPrimaryPort |
In |
Yes |
VPMPort |
Electrical port belonging to the primary
device reference. |
iSecondaryDevice |
In |
Yes |
ProductOccurrence |
Secondary device occurrence
The element may be a device occurrence or a NULL object if no
device is connected to the corresponding port.
|
iSecondaryPort |
In |
Yes |
VPMPort |
The connected electrical port.
The element may be an electrical port or a NULL object if no
device is connected to the input port.
|
oClockingAngle |
Out |
Yes |
Angle |
Clocking angle between primary and secondary
devices. |
oClockingBehaviour |
Out |
Yes |
String |
Clocking behavior between primary and
secondary devices. |
oClockingStatus |
Out |
Yes |
String |
Clocking angle between primary and secondary
devices. |
Example
The following sample illustrates how to get the resultant clocking angle and
resultant clocking behavior.
//PrimaryDevice=ProductOccurrence
//SecondaryDevice=ProductOccurrence
let iSingleConnectorRef(Elec3DSingleInsertConnector)
let iBackshellRef(Elec3DBackShell)
set iSingleConnectorRef=PrimaryDevice.Reference
set iBackshellRef=SecondaryDevice.Reference
let LElecPortType(List)
let LBackShellCnctPt(List)
let nb_Backshell_cnctpt_Primary(Integer)
let nb_Backshell_cnctpt_Secondary(Integer)
LElecPortType.Append("Elec3DBackShellConnectionPoint")
let BackShellCnctpt_Primary(Elec3DBackShellConnectionPoint)
let BackShellCnctpt_Secondary(Elec3DBackShellConnectionPoint)
ListElectricalConnectionPoints(iSingleConnectorRef,LElecPortType,LBackShellCnctPt)
nb_Backshell_cnctpt_Primary=LBackShellCnctPt.Size()
if ( nb_Backshell_cnctpt_Primary > 0 ) set BackShellCnctpt_Primary = LBackShellCnctPt->GetItem(1)
LBackShellCnctPt.RemoveAll()
ListElectricalConnectionPoints(iBackshellRef,LElecPortType,LBackShellCnctPt)
nb_Backshell_cnctpt_Secondary=LBackShellCnctPt.Size()
if ( nb_Backshell_cnctpt_Secondary >0 ) set BackShellCnctpt_Secondary = LBackShellCnctPt->GetItem(1)
let ClockingAngle(Angle)
let ClockingBehaviour(String)
let ClockingStatus(String)
set ClockingBehaviour=" "
set ClockingStatus=" "
GetClockingAngle(PrimaryDevice,BackShellCnctpt_Primary,SecondaryDevice,BackShellCnctpt_Secondary,ClockingAngle,ClockingBehaviour,ClockingStatus)
Notify("Clocking Angle is: ", ClockingAngle)
Notify("Clocking Behaviour is: ", ClockingBehaviour)
Notify("ClockingStatus is: ", ClockingStatus)
GetDeviceDistantLinks
Retrieves
the list of distant branch links for a device.
Signature
GetDeviceDistantLinks(ToDeviceOccurrence : ProductOccurrence, ListDistantLink : List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ToDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Device occurrence with distant links. |
ListDistantLink |
Out |
Yes |
List |
List of distant branch link feature involving
this device occurrence. |
ReturnType
Boolean
The function returns TRUE if all the distant links are retrieved.
The function returns FALSE if the distant links are not retrieved.
GetLinked3DHarness
The GetLinked3DHarness function is used to get the 3D harness product linked with
the input-flattened harness.
Signature
GetLinked3DHarness (FlattenedHarnessProduct : VPMReference, Linked3DHarnessProduct: out : VPMReference): Boolean
Arguments
| Name |
In / out |
Required |
Type |
Comment |
| FlattenedHarnessProduct |
In |
Yes |
VPMReference |
Input flattened product |
| Linked3DHarnessProduct |
Out |
Yes |
VPMReference |
Linked 3D harness product |
Example
let FlattenedHarnessProduct(VPMReference)
let Linked3DHarnessProduct(VPMReference)
let result (Boolean)
result = GetLinked3DHarness(FlattenedHarnessProduct, Linked3DHarnessProduct)
if(result == true && NULL <> Linked3DHarnessProduct)
{
Message = "3D harness product retrieved successfully"
}
**Replace the above EKL script with below EKL Script
let LinkedFlattenedProducts(List)
let myEMPresultProduct(VPMReference)
let result (Boolean)
result = ListLinkedFlattenedHarnesses(HarnessProduct, LinkedFlattenedProducts)
let ListSize(Integer)
ListSize=0
Let myEMPresultProductName(String)
ListSize= LinkedFlattenedProducts.Size()
Let i(integer)
i=1
for i while i <= ListSize
{
myEMPresultProduct= LinkedFlattenedProducts.GetItem(i)
myEMPresultProductName = myEMPresultProduct.Name
Notify("EMP result found #", i, " with name : ", myEMPresultProductName)
}
GetLogicalRoutable
In the context of a logical to physical synchronization, this function
retrieves the logical routable (wire or cable) linked with a physical routable
(conductor or conductor group).
Exposing the link between your logical and physical conductors allows you to check
the consistency of your logical and physical content.
Signature
GetLogicalRoutable(PhysicalRoutable : Feature, LogicalRoutable : EleLogicalConductorOcc) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
PhysicalRoutable
|
In |
Yes |
Feature |
The type of the feature must be conductor or
ConductorGroup. |
LogicalRoutable
|
out |
Yes |
EleLogicalConductorOcc |
- |
ReturnType
Boolean
The function returns TRUE when it is successfully executed, even if no linked
logical routable is found.
The function returns FALSE if the logical content is not opened in session.
Example
let bool(BOOLEAN)
let logicalConductor(EleLogicalConductor)
let sMessage(STRING)
bool = Object.GetLogicalConductor( Object, logicalConductor)
if(NULL <> logicalConductor)
{
sMessage="Name of Logical Conductor: "+logicalConductor.Name
}
else
{
sMessage="Logical Conductor not found!!"
}
Notify(sMessage)
GetPhysicalRoutable
In the context of a logical to physical synchronization, this function
retrieves the physical routable (conductor or conductor group) linked with a logical
routable (wire or cable).
Exposing the link between your logical and physical conductors allows you to check
the consistency of your logical and physical content.
Signature
GetPhysicalRoutable(LogicalRoutable : EleLogicalConductorOcc, PhysicalRoutable : Feature) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
LogicalRoutable
|
In |
Yes |
EleLogicalConductorOcc |
- |
PhysicalRoutable
|
out |
Yes |
Feature |
The type of the feature must be conductor or
ConductorGroup. |
ReturnType
Boolean
The function returns TRUE when it is successfully executed, even if no linked
physical routable is found.
The function returns FALSE if the physical content is not opened in session.
Example
let bool(BOOLEAN)
let physicalConductor(Conductor)
let sMessage(STRING)
bool = Object.GetPhysicalConductor( Object, physicalConductor)
if(NULL <> physicalConductor)
{
sMessage="Name of Physical Conductor: "+physicalConductor.Name
}
else
{
sMessage="Logical Conductor not found!!"
}
Notify(sMessage)
InitContext
Signature
InitContext(VPMReference : VPMReference) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
VPMReference |
In |
Yes |
VPMReference |
- |
InstanciateProtectionCenteredOnPoint
The InstanciateProtectionCenteredOnPoint function is used to instantiate a
protection on segments centered on a given point.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Segment
|
In |
Yes |
Segment
|
The segment the protection is instantiated
on. |
ProtectionType
|
In |
Yes |
String
|
The type of protection (Adaptive, Fixed,
Tape, CorrugatedTube). |
Length
|
In |
Yes |
LENGTH |
The length of instantiated protections on both
sides of the point. |
Point
|
In |
Yes |
Point |
The point the protection is centered on. This
point can be either a protection extremity or a segment
extremity. |
Protection
|
Out |
Yes |
InternalProtection
|
The instantiated protection. Note:
The
returned protection can be adapted by setting its part
number, its internal diameter (for fixed protections), and
its width.
|
Example
/* Check created by ie6 9/26/2013 */
Let Ref(VPMReference)
Let Inst(VPMInstance)
let Protection(internalProtection)
let Ext1(SegmentExtremity)
let Ext2(SegmentExtremity)
let Protectiontype(String)
let ResultExt(Boolean)
let ResultIP(Boolean)
let Protectionlength(Real)
let InputSegment(Segment)
let Name(String)
let CenterPoint(Point)
let SegOwner(Feature)
let sSegOwnerName(String)
let sMessage(String)
let BranchOwner(Feature)
let sBranchOwnerName(String)
Let ListObjects (LIST)
let sMidPointName(String)
let index (INTEGER)
set Protectionlength = 50mm
set Protectiontype = "InternalTape"
SegOwner= Obj.Owner
sSegOwnerName = SegOwner.Name
set sMessage = "Owner of this segment is " + sSegOwnerName
/*Message(sMessage)*/
ResultExt=Obj.Elec_BundleSegmentExtremities(Ext1,Ext2)
Name=Obj.Name
BranchOwner=SegOwner.Owner
sBranchOwnerName = BranchOwner.Name
set sMessage = "Owner of this Branch is " + sBranchOwnerName
/*Message(sMessage)*/
set Inst=BranchOwner
set Ref = Inst.Reference
if (NULL <> Ref )
{
set index = 1
ListObjects=Ref->Query("Point","")
for index while index <= ListObjects.Size()
{
set CenterPoint= ListObjects->GetItem(index)
if(NULL <>CenterPoint)
{
set sMidPointName=CenterPoint.Name
if(0 == sMidPointName.Search("MidPoint"))
{
ResultIP=InstanciateProtectionCenteredOnPoint(InputSegment,Protectiontype,Protectionlength,CenterPoint,Protection)
if(ResultIP<>True)
Message("Protection not instantiated")
else
Message("Protection instantiated")
}
}
}
}
else set sMessage = "Reference not found"
/*ResultIP=InstanciateProtectionCenteredOnPoint(InputSegment,Protectiontype,Protectionlength,CenterPoint,Protection)
if(ResultIP<>True)
Message("Protection not instantiated")*/
InstantiateProtectionExtremityToExtremity
The InstantiateProtectionExtremityToExtremity function instantiates a
protection on a segment between its extremities with input offsets from respective
extremities.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Segment
|
In |
Yes |
Segment
|
The segment on which the protection is
instantiated. |
ProtectionType
|
In |
Yes |
String
|
The type of protection (Adaptive, Fixed, Tape,
CorrugatedTube). |
LengthfrmExt1
|
In |
Yes |
LENGTH |
The offset length of the instantiated
protections from the start extremity of the segment. |
LengthfrmExt2
|
In |
Yes |
LENGTH |
The offset length of the instantiated
protections from the end extremity of the segment. |
Protection
|
Out |
Yes |
InternalProtection
|
The instantiated protection. |
Example
let Protection(InternalProtection)
let ProtectionType(STRING)
let resultIP(BOOLEAN)
let Name(STRING)
let length1(LENGTH)
let length2(LENGTH)
set length1 = 5mm
set length2 = 5mm
Name = Obj.Name
if(Name == "TapeSegment")
{
ProtectionType= "InternalTape"
resultIP = InstantiateProtectionExtremityToExtremity(Obj,ProtectionType,length1, length2, Protection)
if(resultIP<>True)
Message("Protection for Internal Tape is not instantiated")
else
Message("Protection for Internal Tape is instantiated")
}
set length1 = 10mm
set length2 = 10mm
if(Name == "AdaptiveSegment")
{
ProtectionType= "InternalAdaptive"
resultIP=InstantiateProtectionExtremityToExtremity(Obj,ProtectionType,length1, length2,Protection)
if(resultIP<>True)
Message("Protection for Internal Tape is not instantiated")
else
Message("Protection for Adaptive Segment is instantiated")
}
set length1 = 15mm
set length2 = 15mm
if(Name == "CorrugateSegment")
{
ProtectionType= "InternalCorrugate"
resultIP=InstantiateProtectionExtremityToExtremity(Obj,ProtectionType,length1, length2,Protection)
if(resultIP<>True)
Message("Protection for Corrugate Segment is not instantiated")
else
Message("Protection for Corrugate Segment is instantiated")
}
set length1 = 20mm
set length2 = 20mm
if(Name == "FixedSegment")
{
ProtectionType= "InternalFixed"
resultIP=InstantiateProtectionExtremityToExtremity(Obj,ProtectionType,length1, length2,Protection)
if(resultIP<>True)
Message("Protection for Internal Tape is not instantiated")
else
Message("Protection for Fixed Segment is instantiated")
}
InstanciateProtectionOnProtection
The InstanciateProtectionOnProtection function is exposed on an internal
protection to instantiate the internal protection of a given type.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
ProtectionType
|
In |
Yes |
String
|
Type of protection to be instantiated.
|
Protection
|
In |
Yes |
InternalProtection |
The protection on which other protections are
instantiated. |
Length
|
In |
Yes |
LENGTH |
Length of the protection to be instantiated
|
ListOfProtection
|
Out |
Yes |
List
|
List of protections which are instantiated in
the given protection's segment |
Example
ProtectionObj : InternalProtection
let result(BOOLEAN)
let Type(STRING)
let Length(Length)
let ListOfProtections(LIST)
Type = "InternalTape"
Length = 20mm
if(ProtectionObj.Name == "Tape.1")
{
result = InstanciateProtectionOnProtection (Type, ProtectionObj, Length, ListOfProtections)
if(result <> true)
{
Message("Internal protection instanciation Failed on #",ProtectionObj.Name)
}
}
InstanciateProtectionOnSegmentExtremity
The InstanciateProtectionOnSegmentExtremity user function is used to create
an instance of an internal protection of a given type on a branchable of a given
extremity of required length.
Signature
InstanciateProtectionOnSegmentExtremity(SegmentExtremity : SegmentExtremity, ProtectionType : String, Length : LENGTH, Protection : InternalProtection) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
SegmentExtremity
|
In |
Yes |
SegmentExtremity |
Referring segment extremity to which, the
protection is to be instantiated on its parent segment. |
ProtectionType
|
In |
Yes |
String
|
Type of protection to be instantiated.
|
Length
|
In |
Yes |
Length |
Length of protection to be instantiated.
|
Protection
|
Out |
Yes |
InternalProtection
|
Return the instantiated protection. |
Example
Seg : Segment
let result(BOOLEAN)
let SegExt1(SegmentExtremity)
let SegExt2(SegmentExtremity)
let lengthOfProtection(Length)
let ProtectionType(String)
let oProtection(InternalProtection)
set lengthOfProtection = 10mm
set result = False
if(Seg.Name == "Segment.1")
{
ProtectionType= "InternalAdaptive"
result = Seg->Elec_BundleSegmentExtremities(SegExt1, SegExt2)
set result = False
if(SegExt1.Name == "SegmentEnd.1")
result = InstanciateProtectionOnSegmentExtremity( SegExt1, ProtectionType, lengthOfProtection, oProtection)
if(result <> True)
Message("Protection not instantiated on the SegmentExtremity, #", SegExt1.Name )
set result = False
if(SegExt2.Name == "SegmentEnd.2")
result = InstanciateProtectionOnSegmentExtremity( SegExt2, ProtectionType, lengthOfProtection, oProtection)
if(result <> True)
Message("Protection not instantiated on the SegmentExtremity, #", SegExt2.Name )
}
IsConsistent
IsDeviceConnexionPossible
Signature
IsDeviceConnexionPossible(ElectricalDeviceOccurrence : ProductOccurrence, ElectricalDeviceOccurrence : ProductOccurrence, bIsConnextionPossible : Boolean) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ElectricalDeviceOccurrence |
In |
|
ProductOccurrence |
- |
ElectricalDeviceOccurrence |
In |
|
ProductOccurrence |
- |
bIsConnextionPossible |
Out |
|
Boolean |
- |
LinkedSpecification
The LinkedSpecification user function is used to get the specification of a
conductor or a conductor group from its instance.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Instance
|
In |
Yes |
VPMInstance |
The input instance of the conductor or
conductor group. |
Conductor or
ConductorGroup |
Out |
Yes |
Conductor
or ConductorGroup |
Returns the representation of the input
conductor or ConductorGroup. |
Example
ElecSystem : VPMInstance
let sRelatedInstance(STRING)
let condSpec(Conductor)
let sCondSpec(String)
let condGrpSpec(ConductorGroup)
let sCondGrpSpec(String)
let bVal(Boolean)
set sRelatedInstance = ElecSystem.Name
if ( sRelatedInstance == "Conductor01")
{
bVal = LinkedSpecification(ElecSystem, condSpec)
set sCondSpec = condSpec.Name
if((true <> bVal) or ( sCondSpec <> "ConductorSpec01_01"))
Message("No Related Spec found for #", sRelatedInstance)
}
if ( sRelatedInstance == "ConductorGroup01.1")
{
bVal = LinkedSpecification(ElecSystem, condGrpSpec)
set sCondGrpSpec = condGrpSpec.Name
if((true <> bVal) or ( sCondGrpSpec <> "ConductorGroupSpec02_01.1"))
Message("No Related Spec found for #", sRelatedInstance)
}
ListAllOuterLayerObjects
The ListAllOuterLayerObjects user function is exposed to list all the
protections or supports covering a segment extremity or a given location of a
branch.
Signature
ListAllOuterLayerObjects(SegmentExtremity : Feature, Offset : Real, ListOfAllCoveringProducts(Protections/Supports) : List [, TypeToList : Integer]) : Boolean
Note:
Optional argument: TypeToList. The default argument of type
integer is added in the signature for which valid values are:
- 1 = all types of protections
- 2 = supports
If this argument is not passed or any other value is passed, all the outer
layer objects are returned.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
SegmentExtremity
|
In |
Yes |
Feature
|
None |
Offsetratio
|
In |
Yes |
Real
|
Used to list the covering elements not present
at a segment extremity but present at an offset from the segment
extremity. |
ListOfAllCoveringProducts(Protections/Supports)
|
Out |
Yes |
List
|
None |
TypeToList
|
In |
No |
Integer
|
Optional |
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)
}
ListCables
This function retrieves the list of cables currently in session and
using an input device occurrence as an end or as an intermediate junction
device.
Signature
ListCables(DeviceOccurrence: ProductOccurrence, ListCables: List, ListPorts: List): Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
DeviceOccurrence |
In |
|
ProductOccurrence |
Input device occurrence |
ListCables |
Out |
|
List |
List of cables using the input device as an
end or as an intermediate junction device. The size
corresponds to the size of the mapped
ListPorts and index. |
ListPorts |
Out |
|
List |
List of ports used by the cables. The size
corresponds to the size of the mapped
ListCables and index. The
argument can contain NULL values if the cable is directly
connected to the device without using any port. |
ReturnType
Integer
The function returns 0 if an error is detected.
The function returns 1 if it succeeds.
ListCablesWithCores
This function retrieves the list of cables currently in session and using an
input device occurrence as an end or as an intermediate junction device.
Signature
ListCablesWithCores (DeviceOccurrence: ProductOccurrence, ListCores: List, ListCables: List, ListPorts: List): Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
DeviceOccurrence |
In |
Yes |
ProductOccurrence |
Input device occurrence |
ListCableCoress |
Out |
Yes |
List |
List of cable cores using the input device as an end or as an
intermediate junction device.
The size corresponds to the size of the mapped
ListCables and index. Element of list
can be null.
|
ListCables |
Out |
Yes |
List |
List of cables using the input device as an end or as an
intermediate junction device.
The size corresponds to the size of the mapped
ListPorts and index.
|
ListPorts |
Out |
Yes |
List |
List of ports used by the cables.
The size corresponds to the size of the mapped
ListCables and index.
The argument can contain NULL values if the cable is directly
connected to the device without using any port.
|
ReturnType
Integer
The function returns 0 if an error is detected.
The function returns 1 if it succeeds.
Example
/*
Argument List
SelectedDevice ==> ProductOccurrence
*/
Notify("Selected Device : ", SelectedDevice.Name)
let bool (Boolean)
let ListCores(List)
let ListCables(List)
let ListPorts(List)
ListCores.RemoveAll()
ListCables.RemoveAll()
ListPorts.RemoveAll()
set bool=ListCablesWithCores(SelectedDevice, ListCores, ListCables, ListPorts)
let ListCablesSize(Integer)
ListCablesSize=0
ListCablesSize=ListCables.Size()
let myCable(Elec3DCable)
let myCore(Elec3DCableCore)
let myPort(ElecPort)
let i(Integer)
let CoreName(String)
if ListCablesSize==0
Notify("No cable connected to this device")
else
{
Notify("Number of cables linked to this Device : ", ListCablesSize)
i=1
for i while i <= ListCablesSize
{
myCable=ListCables.GetItem(i)
myCore=ListCores.GetItem(i)
myPort=ListPorts.GetItem(i)
if myCore<>NULL
{
myCore.GetName(CoreName)
if myPort<>NULL
Notify("Cable : ", myCable.Name, " has core : ", CoreName, " linked to device Port : ", myPort.V_FunctionalName)
else if myPort==NULL
Notify("Cable : ", myCable.Name, " has core : ", CoreName, " not linked to any device port")
}
else if myCore==NULL
{
if myPort<>NULL
Notify("Cable : ", myCable.Name, " is itself linked to device Port : ", myPort.V_FunctionalName)
else if myPort==NULL
Notify("Cable : ", myCable.Name, " is not linked to any device port")
}
}
}
ListConnectedDevices
This function retrieves all the device occurrences connected to the electrical
port of a device occurrence.
Signature
ListConnectedDevices(iDeviceOccurrence : ProductOccurrence, iListElectricalPort : List, oListConnectedOccurrence : List, oListConnectedPort : List) : Boolean
ListConnectedDevices(iDeviceOccurrence : ProductOccurrence, oListConnectedOccurrence : List, oListConnectedPort : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
| iDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Input device occurrence |
| ListOfCnctPoints |
In |
Yes |
List
|
List of electrical ports belonging to the
current device reference. |
| oListConnectedOccurrence |
Out |
Yes |
List |
List of connected device occurrences.
Element of list may be a list of device occurrences or a
NULL object if no device is connected to the corresponding
input port.
|
| oListConnectedPort |
Out |
Yes |
List |
List of the connected electrical ports of the
connected device. Element of list may be a list electrical
ports or a NULL object if no device is connected to the
port.
|
ReturnType
Boolean
The function returns FALSE if:
- Input occurrence is not an electrical device occurrence.
- Any input port is not an electrical port.
- The search for connection fails.
Example
The following sample illustrates how to list the devices connected to the
cavities of equipment.
// List all devices on all cavities
/* input : DeviceOccurrence ProductOccurrence */
let DeviceRef(VPMReference)
DeviceRef = DeviceOccurrence.Reference
// List all cavities on the device occurrence
let LElecPortType(List)
LElecPortType.Append("Elec3DCavity")
let ListPorts(List)
ListElectricalConnectionPoints(DeviceRef, LElecPortType, ListPorts)
let LConnectedDevices(List)
let LConnectedPorts(List)
ListConnectedDevices(DeviceOccurrence,ListPorts, LConnectedDevices,LConnectedPorts)
let list(List)
for list inside LConnectedDevices
{
let device(ProductOccurrence)
for device inside list
{
Notify ( " Device : ",device.Name," is connected")
}
}
ListConnectedNodes
This function retrieves all the nodes (and their associated arcs) connected
to a device occurrence.
A device node is computed on an electrical port only if the device electrical port is
connected to the branch extremities.
Signature
ListConnectedNodes(iDeviceOccurrence : ProductOccurrence, oListConnectedNodes : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
| iDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Input device occurrence |
| oListConnectedNodes |
Out |
Yes |
List |
The nodes correspond to the segment
extremities connected to the device electrical ports. |
ReturnType
Boolean
The function returns FALSE if:
- The input occurrence is not an electrical device occurrence.
- The search for connected segment extremities fails.
Sample
The following sample illustrates how to retrieve the segments connected to
cavities or segment connection points.
For each node, the CreateAdvancedConnectionPoint method is used to retrieve:
- The device occurrence
- The connection point
- The segment extremities. For each extremity, the segment and branch are
retrieved.
/* Retrieve the segments connected to a selected device */
let NodeList(List)
let myNode(Elec3DDeviceNode) // init device node
let NodeOccurrence(ProductOccurrence)
let NodeCnctPt(VPMPort)
let NodeFeatures(List)
let nb_elem(Integer)
let i_elem(Integer)
let nb_node(Integer)
let index(Integer)
let Bns_ext(SegmentExtremity)
let Bns(Segment)
let Bns_branch(Branch)
//
// retrieve connected nodes ( segment connection points or cavities connected to segment extremity )
ListConnectedNodes(myDeviceOccurrence,NodeList)
nb_node=NodeList.Size()
index=1
for index while index <= nb_node
{
set myNode= NodeList->GetItem(index) // node
if ( myNode <> NULL )
{
// retrieve the node components : device occurrence - connection point - segment extremities connected
myNode->GetComponents(NodeOccurrence,NodeCnctPt,NodeFeatures)
nb_elem = NodeFeatures.Size()
i_elem=1
for i_elem while i_elem <= nb_elem
{
set Bns_ext= NodeFeatures->GetItem(i_elem) // segment extremity expected
if ( Bns_ext <> NULL )
{
set Bns=Bns_ext.Owner
set Bns_branch=Bns.Owner
Notify ( "Connection point : ",NodeCnctPt.V_FunctionalName, " connected to ", Bns_branch.Name,"/", Bns.Name )
}
i_elem=i_elem+1
}
}
index = index+1
}
Message ( " number of connection point connected to branch :",nb_node )
ListConnectedMechanicalAccessories
Return the list of mechanical accessories connected to a given device
occurrence.
Signature
ListConnectedMechanicalAccessories (iDeviceOccurrence : VPMOccurrence, ListofConnectedMechAccessories : List of VPMOccurrence) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
| iDeviceOccurrence |
In |
Yes |
VPMOccurrence |
The accessorizable device occurrence
(Connector, Multi Insert Connector, Shell, Stud, Terminal Strip,
Terminal Block, or Mounting Equipment). |
| ListofConnectedMechAccessories |
Out |
Yes |
List of VPMOccurrence |
Output list containing the mechanical
accessory occurrences connected to the device. |
ReturnType
Boolean
TRUE if the function is executed correctly (even if no accessory is found and the
list is empty); FALSE otherwise.
Sample
/* ListConnectedMechanicalAccessories — Example */
/* input : Dev1 ProductOccurrence (Accessorizable device occurrence: Connector, Multi Insert Connector, Shell, Stud, Terminal Strip, Terminal Block, or Mounting Equipment) */
Let LAccessories (List)
Let ok (Boolean)
Let size (Integer)
Let index (Integer)
Let sName (STRING)
Let sMessage (STRING)
Let AccOcc (ProductOccurrence)
/* Call the function */
ok = ListConnectedMechanicalAccessories(Dev1, LAccessories)
/* Report */
if (ok == TRUE)
{
size = LAccessories.Size()
Notify("Connected mechanical accessories count = " + size)
sMessage = "("
index = 1
for index while index <= size
{
AccOcc = LAccessories->GetItem(index)
sName = "NULL"
if (AccOcc <> NULL)
{
sName = AccOcc.V_Name (Title)
}
sMessage = sMessage + sName
if (index < size) { sMessage = sMessage + ", " }
index = index + 1
}
sMessage = sMessage + ")"
Notify(sMessage)
}
else
{
Notify("Result = FALSE: ListConnectedMechanicalAccessories failed (invalid input device or search error).") }
ListDirectlyCoveredObjects
The ListDirectlyCoveredObjects user function can be used in Quality Rules Reuse.
Signature
ListDirectlyCoveredObjects((Protection/Support) : Feature, ListOfCoveredProducts(Segments/Protections/Supports) : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
(Protection/Support)
|
In |
Yes |
Feature
|
None |
ListOfCoveredProducts(Segments/Protections/Supports)
|
Out |
Yes |
List
|
None |
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:Protectionlet 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 analyzed component, 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 Quality Rules Reuse.
Signature
ListDirectlyOuterLayerObjects((Segment/Protection/Support) : Feature, ListOfCoveringProducts(Protections/Supports) : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
(Segment/Protection/Support)
|
In |
Yes |
Feature
|
None |
ListOfCoveringProducts(Protections/Supports)
|
Out |
Yes |
List
|
None |
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 analyzed component, in our case, the segment.
- The number of outer layers over the segment:
Information: Number
of outer layers = 3. Only three 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
ListElecGuideCurves
Signature
(Elec3DDuct : Elec3DDuct, ListCurves : List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Elec3DDuct |
In |
|
Elec3DDuct |
- |
ListCurves |
Out |
|
List |
- |
ListElectricalConnectedObjects
The ListElectricalConnectedObjects function is exposed on device instances
and is used to get the list of objects connected with the device
instance.
Signature
ListElectricalConnectedObjects(DeviceInstance : VPMInstance, ConnectionPointName : String, ListConnectedDevice : List, ListConnectedConnectionPoint : List, ListConnectionActivity : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
DeviceInstance
|
In |
Yes |
VPMInstance |
None |
ConnectionPointName
|
In |
Yes |
String
|
None |
ListConnectedDevice
|
Out |
Yes |
List
|
A list of devices connected with MCX. |
ListConnectedConnectionPoint
|
Out |
Yes |
List
|
A list of connection points used to connect
the devices. |
ListConnectionActivity
|
Out |
Yes |
List
|
A list of the activity of the MCX used to
connect devices. If the related MCX is activated, then the
value is 1.
If the related MCX is deactivated, the value is 0.
|
ListElectricalConnectionPoints
The ListElectricalConnectionPoints function is exposed on device references
and allows retrieving electrical connection points of a specific
type.
Signature
ListElectricalConnectionPoints(Reference : VPMReference, TypesToList : List, ListOfCnctPoints : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Reference
|
Input |
Yes |
VPMReference |
Reference for which connection points are listed.
Supported reference types: equipment, electrical device,
electrical branch geometry, piping part (with electrical
behavior).
|
TypesToList
|
Input |
Yes |
List
|
List of connection point types to find in
input reference. This list should contain names of knowledge
types of required connection points. For example,
Elec3DCavity.
|
ListOfCnctPoints
|
Output |
Yes |
List
|
List of connection points of input type.
NULL if the connection point of required type is not
found.
|
ReturnType
Boolean
The function returns TRUE if the input reference is valid and if the types' names
in TypesToList are correct, even if the connection point of
required type is not found.
The function returns FALSE if:
- Input reference is not supported.
- A connection point type's name in
TypesToList is
invalid.
- The search for connection points fails.
Valid Names for Connection Points Types
| TypeToList |
Valid Names |
| Elec3DCavity, Elec3DCavityV5,
Elec3DConnectorConnectionPoint,
Elec3DConnectorConnectionPointV5,
Elec3DBackShellConnectionPoint,
Elec3DBackShellConnectionPointV5,
Elec3DShellConnectionPoint, Elec3DShellConnectionPointV5,
Elec3DSegmentConnectionPoint,
Elec3DSegmentConnectionPointV5, Elec3DCavityConnectionPoint,
Elec3DCavityConnectionPointV5 |
Electrical device (shell, backshell,
mounting equipment, contact, filler plug, single insert
connector, multi-insert connector, stud, splice, terminal
strip and terminal block), equipment, piping part (with
electrical behavior). |
| Elec3DSegmentPositionPoint,
Elec3DSegmentPositionPointV5 |
Splice reference |
| Elec3DSplicePositionPoint,
Elec3DSplicePositionPointV5 |
Electrical branch geometry |
Example
let typesToList(List)
let listOfCnctPt1(List)
let cnCtPt (ElecPort)
let index(Integer)
let size(Integer)
let sName (String)
let sMessage (String)
let bool (Boolean)
/* Start:----- EQT ----------*/
/* Creation of input type name list */
/* Case 1 */
typesToList.Append("Elec3DCavity")
/* Case 2: Comment above lines and uncomment */
/* typesToList.Append("Elec3DCavityV5") */
/* Case 3: Comment above lines and uncomment */
/*typesToList.Append("Elec3DCavityConnectionPoint")*/
/* Case 4: Comment above lines and uncomment */
/*typesToList.Append("Elec3DCavityConnectionPointV5")*/
/* Case 5: Comment above lines and uncomment */
/*typesToList.Append("Elec3DCavity")
typesToList.Append("Elec3DCavityV5")
typesToList.Append("Elec3DCavityConnectionPoint")*/
/* Case 6: Comment above lines and uncomment */
/*typesToList.Append("PipingPort")*/
/* End: ----- EQT ----------*/
/* Start:----- Splice ----------*/
/* Creation of input type name list */
/* Case 7 Comment above lines and uncomment */
/*typesToList.Append("Elec3DSegmentConnectionPoint")*/
/* Case 8: Comment above lines and uncomment */
/* typesToList.Append("Elec3DSegmentPositionPoint") */
/* Case 9: Comment above lines and uncomment */
/*typesToList.Append("Elec3DSegmentConnectionPoint")
typesToList.Append("Elec3DSegmentPositionPoint") */
/* Case 10: Comment above lines and uncomment */
/*typesToList.Append("Elec3DSplicePositionPoint")*/
/* End: ----- Splice ----------*/
/* Start:----- PipingPort ----------*/
/* Creation of input type name list */
/* Case 11 Comment above lines and uncomment */
/*typesToList.Append("Elec3DCavity")*/
/* Case 12: Comment above lines and uncomment */
/* typesToList.Append("Elec3DCavityConnectionPoint") */
/* Case 13: Comment above lines and uncomment */
/*typesToList.Append("Elec3DSegmentConnectionPoint")*/
/* End: ----- PipingPort ----------*/
/* Start:----- EBG ----------*/
/* Creation of input type name list */
/* Case 14 Comment above lines and uncomment */
/*typesToList.Append("Elec3DCavityV5")*/
/* Case 15: Comment above lines and uncomment */
/* typesToList.Append("Elec3DSplicePositionPoint") */
/* End: ----- EBG ----------*/
Notify("---------------------------------------------------")
Notify("Reference Treated : #", ref.Name)
bool = ListElectricalConnectionPoints (ref, typesToList, listOfCnctPt1)
if(bool == TRUE)
{
set index = 1
size = listOfCnctPt1.Size()
Notify("Result = True, Elements in list - #", size)
sMessage = " ("
for index while index <= size
{
sName = "NULL"
set cnCtPt = listOfCnctPt1->GetItem(index)
if(cnCtPt <> NULL)
{
set sName = cnCtPt.V_FunctionalName
}
sMessage = sMessage + sName + ","
}
sMessage = sMessage + ")"
Notify(sMessage)
}
else
{
Notify("Result = ListElectricalConnectionPoint fails: May be Input list of type is incorrect")
}
ListElectricalConnectionPointsNames
The ListElectricalConnectionPointsNames function is exposed on device
instances and is used to get the list of connection point names and the list of
connection types in the device instance.
Signature
ListElectricalConnectionPointsNames(DeviceInstance : VPMInstance, ListOfNames : List, ListOfTypeNames : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
DeviceInstance
|
In |
Yes |
VPMInstance |
None |
ListOfNames
|
Out |
Yes |
List
|
None |
ListOfTypeNames
|
Out |
Yes |
List
|
None |
Example
Here is a 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.V_Name (Title) + 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 ListElectricalWires function is exposed on device instances and is used
to get the list of conductors connected to the device and the list of connection
point names with which the conductor is connected to the device instance.
Signature
ListElectricalWires(DeviceInstance : VPMInstance, ListOfWires : List, ListOfConnectionPointName : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
DeviceInstance
|
In |
Yes |
VPMInstance |
None |
ListOfWires
|
Out |
Yes |
List
|
None |
ListOfConnectionPointName
|
Out |
Yes |
List
|
None |
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")
}
ListElectricalGuideCurves
The ListElectricalGuideCurves function is exposed on duct references and allows
retrieving electrical guide curves of a specific
type.
Signature
ListElectricalGuideCurves(DuctReference : Elec3DDuct, ListOfElecGuideCurve : List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
DuctReference |
In |
|
DuctReference |
Reference for which guide curves are
listed. |
ListOfElecGuideCurve |
Out |
|
List |
A list of electrical guide curves can be NULL
if no electrical guide curves are not found. |
ReturnType
Boolean
The function returns TRUE if the input duct reference is valid even if the
electrical guide curve is not found.
The function returns FALSE if:
- Search for electrical guide curve fails.
ListExtensionGuideCurves
Signature
ListExtensionGuideCurves(ElectricalBranchGeometry : ElectricalBranchGeometry, ListOfElecGuideCurve : List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ElectricalBranchGeometry |
In |
|
ElectricalBranchGeometry |
EBG Reference in which guide curves are
searched. |
ListOfElecGuideCurve |
Out |
|
List |
List of electrical guide curves NULL if no
electrical guide curves are found. |
ReturnType
Boolean
The function returns TRUE if the input electrical branch geometry reference is
valid and if the electrical guide curve is found.
The function returns FALSE if:
- Search for electrical guide curve fails.
ListLinkedFlattenedHarnesses
The ListLinkedFlattenedHarnesses function is used to get the flattened products
linked with the input 3D harness.
Signature
ListLinkedFlattenedHarnesses (3DHarnessProduct : VPMReference, Linked3DFlattenedProducts: out : List): Boolean
Arguments
| Name |
In / out |
Required |
Type |
Comment |
| 3DHarnessProduct |
In |
Yes |
VPMReference |
Input 3D harness product |
| Linked3DFlattenedProducts |
Out |
Yes |
List |
List of flat products created from input
harness |
Example
let 3DHarnessProduct(VPMReference)
let LinkedFlattenedProducts(List)
let result (Boolean)
result = ListLinkedFlattenedHarnesses(3DHarnessProduct, LinkedFlattenedProducts)
ListOuterLayerProtections
The ListOuterLayerProtections user function is exposed on a point and lists
all the protections overlapping the point.
Signature
ListOuterLayerProtections(Point : Point, ListOfProtections : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Point
|
In |
Yes |
Point |
The point on which covering protections are
retrieved. |
ListOfProtections
|
Out |
Yes |
List
|
Returns the list of protections covering the
input point. |
Example
Point : Point
let ListOfProtections(LIST)
let NbProt(INTEGER)
let Protection1(String)
let Protection2(String)
let result(Boolean)
let Prot1(InternalProtection)
let Prot2(InternalProtection)
if(Point.Name == "Point.5")
{
result = ListOuterLayerProtections (Point, ListOfProtections)
if(result <> true)
{
Message("Outer Layer Protections Not found on #",Point.Name)
}
NbProt = ListOfProtections->Size()
if(NbProt <> 2)
{
Message("Incorrect number of Outer Layer Protections # found on #",NbProt,Point.Name)
}
Prot1 = ListOfProtections->GetItem(1)
Protection1 = Prot1.Name
Prot2 = ListOfProtections->GetItem(2)
Protection2 = Prot2.Name
if(("Tape.1"<>Protection1 ) OR ( "Adaptive diameter.1" <>Protection2 ))
{
Message("Incorrect Outer Layer Protection # # found on #",Protection1,Protection2,Point.Name)
}
}
ListProtectionsFromExtremity
The ListProtectionsFromExtremity user function is exposed on a segment
extremity and lists all the protection overlapping the segment extremity.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
SegmentExtremity
|
In |
Yes |
SegmentExtremity |
The segment extremity on which covering
protections are retrieved. |
ListOfProtection
|
Out |
Yes |
List
|
Returns the list of protections covering the
input segment extremity. |
Example
Seg : Segment
let result(BOOLEAN)
let ListOfProtection(List)
let NbProt(INTEGER)
let SegExt1(SegmentExtremity)
let SegExt2(SegmentExtremity)
let Protection(STRING)
let Prot(InternalProtection)
if(Seg.Name == "Segment.2")
{
result = Seg->Elec_BundleSegmentExtremities(SegExt1, SegExt2)
if(SegExt1.Name == "SegmentExtremity.1")
{
result = ListProtectionsFromExtremity (SegExt1, ListOfProtection)
if(result <> true)
{
Message("Protections not found on #",SegExt1.Name)
}
NbProt = ListOfProtection->Size()
if(NbProt <> 1)
{
Message("Incorrect number of Protections # found on #",NbProt,SegExt1.Name)
}
Prot = ListOfProtection->GetItem(1)
Protection = Prot.Name
if("Corrugated tube.1"<>Protection)
{
Message("Incorrect Protection # found on #",Protection,SegExt1.Name)
}
}
}
ListRoutes
This function retrieves the list of cable routes currently in session
and using the input device occurrence as an end device.
Signature
ListRoutes(DeviceOccurrence: ProductOccurrence, ListRoutes: List, ListPorts: List): Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
DeviceOccurrence |
In |
|
ProductOccurrence |
Input device occurrence |
ListRoutes |
Out |
|
List |
List of cable routes using the input device as
an end device. The size corresponds to the size of the mapped
ListPorts and index.
|
ListPorts |
Out |
|
List |
List of ports used by the cable routes. The
size corresponds to the size of the mapped
ListRoutes and index. The
argument can contain NULL values if the cable route is
directly connected to the device without using a
port. |
ReturnType
Integer
The function returns 0 if an error is detected.
The function returns 1 if it succeeds.
ListUsedSupports
The ListUsedSupports user function can be used in Quality Rules Reuse.
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Segment
|
In |
Yes |
Segment |
None |
Supports
|
Out |
Yes |
List
|
None |
Example
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 analyzed segment.
- The number of supports through which the segment is routed
Information No. Used Supports = 7 . Only three 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
ListUsedSupportsWithAbscissa
The ListUsedSupportsWithAbscissa user function can be used in Quality Rules Reuse.
Signature
ListUsedSupportsWithAbscissa(Segment/Branch : Feature, Supports : List, EntryPointAbscissa : List, ExitPointAbscissa : List) : Boolean
Arguments
| Name |
Input / Output |
Required? |
Type |
Comment |
Segment/Branch
|
In |
Yes |
Feature
|
None |
Supports
|
Out |
Yes |
List
|
None |
EntryPointAbscissa
|
Out |
Yes |
List
|
None |
ExitPointAbscissa
|
Out |
Yes |
List
|
None |
Example
An expert rule (created using Quality Rules Reuse) to determine the list of all the supports located along all segments in the
document that also outputs support entry and exit point coordinates is written
as follows:
bs:Branchlet 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))
}
LoadRelatedObjects
RemoveDeviceDistantLinks
Removes
distant branch links of a device.
Signature
RemoveDeviceDistantLinks(ToDeviceOccurrence : ProductOccurrence, ListDistantLink : List) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ToDeviceOccurrence |
In |
Yes |
ProductOccurrence |
Device occurrence with distant links. |
ListDistantLink |
In |
Yes |
List |
List of Elec Device Distant Link features
which are to be deleted. |
ReturnType
Boolean
The function returns TRUE if all distant links are removed.
The function returns FALSE if the distant links removal fails.
ReplaceAdvancedConnectionPoint
- The corresponding standard connection point is created from advanced connection
point data
- The attributes are copied
- The advanced connection point is always deleted
- The name of the new connection is the same as the replaced one.
Signature
ReplaceAdvancedConnectionPoint (iAdvancedCnctPt : ElecPortV5, oNewStandardCnctPt : ElecPort) : Boolean
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
iAvancedCnctPt |
In |
Yes |
ElecPortV5 |
Any type of supported of advanced connection point
- Elec3DCavityV5
- Elec3DConnectorConnectionPointV5
- Elec3DBackShellConnectionPointV5
- Elec3DShellConnectionPointV5
- Elec3DSegmentConnectionPointV5
- Elec3DCavityConnectionPointV5
|
oNewStandardCnctPt |
Out |
Yes |
ElecPort |
- Elec3DCavity
- Elec3DConnectorConnectionPoint
- Elec3DBackShellConnectionPoint
- Elec3DShellConnectionPoint
- Elec3DSegmentConnectionPoint
- Elec3DCavityConnectionPoint
|
ReturnType
Boolean
The function returns TRUE if the standard connection point is correctly
created.
The function returns FALSE if the creation or deletion fails.
ResetElectricalNetworkGraph()
This function allows reseting in the cache all the information related to
your network. You need to call the ResetElectricalNetworkGraph after
any network modification.
Signature
ResetElectricalNetworkGraph(): Boolean
Arguments
There are no arguments for this function.
ReturnType
Boolean
The method returns FALSE if the function fails.
|