Compute New Position of Route Points for Merge Operation (PipComputePointDuringMerge)

An opening ID is an entry point used to customize business logic. Compute New Position of Route Points for Merge Operation allows you to change the two ends of the routes to be merged before the merge operation.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when you merge two routes.

This opening ID is used to customize the shape of the segment between the two routes that have been merged.

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: PipComputePointDuringMerge
Customization intent: Computation
Execution context: Client

Input Objects

Input objects must be of the following types:

  • ThisObject: product occurrence of the rigid route
  • Parameters: corresponds to the context object.

Context Object Parameters

Parameter Name Type Read/Write Comments
MasterRoutePoint (input) List of doubles Read X, Y, Z coordinates
SlaveRoutePoint (input) List Read X, Y, Z coordinates
MasterRouteDirection (input) List Read Vx, Vy, Vz vector
SlaveRouteDirection (input) List Read Vx, Vy, Vz vector
newMasterRoutePoint (output) List Write X, Y, Z coordinates - new position of guideline node
newSlaveRoutePoint (output) List Write X, Y, Z coordinates - new position of subordinate node
extraMasterRoutePoint (output) List Write Optional - an additional node can be created between the guideline and subordinate nodes
Important: The guideline and the subordinate nodes must have different coordinates.

The following image illustrates the behavior of the business logic:



[1]: Guideline route

[2]: Subordinate route

Sample

The following sample explains the merge of two routes with an orthogonal subordinate route as solution.

/* this sample rule is for merging two routes and the solution is that the merged route will be orthogonal to the slave route */
/*Let SlaveRouteOcc(ProductOccurrence)*/		// not required for this sample
/*set SlaveRouteOcc = ThisObject*/

let MasterRoutePoint_attr = "MasterRoutePoint" /*List of MasterRoutePoint Coord */
let MasterRoutePoint_val (List)

let SlaveRoutePoint_attr = "SlaveRoutePoint" /*List of SlaveRoutePoint Coord */
let SlaveRoutePoint_val (List)

let MasterRouteVector_attr = "MasterRouteDirection" /*List of MasterRouteVector Coord */
let MasterRouteVector_val (List)

let SlaveRouteVector_attr = "SlaveRouteDirection" /*List of SlaveRouteVector Coord */
let SlaveRouteVector_val (List)

let MasterPtX (Real)
let MasterPtY (Real)
let MasterPtZ (Real)

let SlavePtX (Real)
let SlavePtY (Real)
let SlavePtZ (Real)

let MasterRouteVectorX (Real)
let MasterRouteVectorY (Real)
let MasterRouteVectorZ (Real)

let SlaveRouteVectorX (Real)
let SlaveRouteVectorY (Real)
let SlaveRouteVectorZ (Real)

set MasterRoutePoint_val = Parameters -> GetAttributeObject (MasterRoutePoint_attr)
MasterPtX = MasterRoutePoint_val.GetItem(1)
MasterPtY = MasterRoutePoint_val.GetItem(2)
MasterPtZ = MasterRoutePoint_val.GetItem(3)

set SlaveRoutePoint_val = Parameters -> GetAttributeObject (SlaveRoutePoint_attr)
SlavePtX = SlaveRoutePoint_val.GetItem(1)
SlavePtY = SlaveRoutePoint_val.GetItem(2)
SlavePtZ = SlaveRoutePoint_val.GetItem(3)

set MasterRouteVector_val = Parameters -> GetAttributeObject (MasterRouteVector_attr)
MasterRouteVectorX = MasterRouteVector_val.GetItem(1)
MasterRouteVectorY = MasterRouteVector_val.GetItem(2)
MasterRouteVectorZ = MasterRouteVector_val.GetItem(3)

set SlaveRouteVector_val = Parameters -> GetAttributeObject (SlaveRouteVector_attr)
SlaveRouteVectorX = SlaveRouteVector_val.GetItem(1)
SlaveRouteVectorY = SlaveRouteVector_val.GetItem(2)
SlaveRouteVectorZ = SlaveRouteVector_val.GetItem(3)

/*---------------------------------------------------------------------------------*/

/*----Logic for merging two parallel routes and obtaining 90 deg solution----*/ 

/*-----Vector xi + yj + zk joining the two extremities-----*/
let x (Real)
let y (Real)
let z (Real)
/*---------------------------------------------------------*/

set x = MasterPtX - SlavePtX
set y = MasterPtY - SlavePtY
set z = MasterPtZ - SlavePtZ

/*-------------Length of vector for projection-----------*/
let vectrlen (Real)
set vectrlen = (x * SlaveRouteVectorX) + (y * SlaveRouteVectorY) + (z * SlaveRouteVectorZ)
/*---------------------------------------------------------*/

let newx (Real)
let newy (Real)
let newz (Real)

set newx = vectrlen * SlaveRouteVectorX
set newy = vectrlen * SlaveRouteVectorY
set newz = vectrlen * SlaveRouteVectorZ

Let nSlavePt_attr = "newSlaveRoutePoint"
Let nSlavePt_val (List)

/*----New point obtained by projection method-----*/
nSlavePt_val.Append(SlavePtX + newx)
nSlavePt_val.Append(SlavePtY + newy)
nSlavePt_val.Append(SlavePtZ + newz)
/*-------------------------------------------------------*/

Let nMasterPt_attr = "newMasterRoutePoint"
Let nMasterPt_val (List)

nMasterPt_val.Append(MasterPtX)
nMasterPt_val.Append(MasterPtY)
nMasterPt_val.Append(MasterPtZ)

Let exMasterPt_attr = "extraMasterRoutePoint"	//Optional Output Parameter
Let exMasterPt_val (List)

//Do not append anything if no output is required
/*exMasterPt_val.Append(MasterPtX)			
exMasterPt_val.Append(MasterPtY)
exMasterPt_val.Append(MasterPtZ)*/

/*---------------------------------------------------------------------------------*/

/*-----------------------------------Outputs-------------------------------------*/
Parameters -> SetAttributeObject(nSlavePt_attr,nSlavePt_val)
Parameters -> SetAttributeObject(nMasterPt_attr,nMasterPt_val)
Parameters -> SetAttributeObject(exMasterPt_attr,exMasterPt_val)
/*---------------------------------------------------------------------------------*/