General InformationThis 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.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
The following image illustrates the behavior of the business logic: [1]: Guideline route [2]: Subordinate route SampleThe 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) /*---------------------------------------------------------------------------------*/ |