Piping ISO/ORTHO Spool Business Rules - Orientation Reference of Piping Parts (CAAAITACPipeOrientationBusinessRules1)

An opening ID is an entry point used to customize business logic. The Piping ISO/ORTHO Spool business rule -Orientation reference of piping parts opening ID is used to define the orientation reference of piping parts.

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 using the Piping Spool Isometrics or the Piping Orthogonal Drawings command.

During the creation of the orientation/weld data table, for each piping part in the spool, a business rule (BR) is called for that piping part to retrieve the following data for a port:

  • The port on the part has a default orientation. For example, a port on a welded flange, a tee, or an elbow has a recognizable orientation, so can serve as a reference for the computation of the roll angle.
  • The port on other parts like a concentric reducer or a stub end has no orientation as it is an axisymmetric part. No need to rotate it by a specific angle. It also cannot serve a reference for orienting other parts that need to be fixed with a specific angle (For example, a welded flange).
  • For the parts that are not to be mentioned at all, like a gasket or similar, for example, the BR has to revert that this needs to be skipped.
  • For welds that are modeled with piping parts (legacy V5 model) the weld-part needs to be identified and the BR has to revert that it is a weld, and it is skipped in the orientation table. Also the weld position number is added to the orientation table.

A straight pipe by default has no orientation, and a bent pipe by default has an orientation (the inside/throat of the closest bend).

The data driven for the weld orientation table is manipulated with a part orientation business rule.

To remove the values that are not required, in case if the orientation is considered as 0 (no rotation), adding a orientation reference attribute value in the business rule logic lets such entries to be excluded from the table. It also reduces the number of generated annotations making the drawing more readable.

If the OrientationReference (also referred as the Rotation angle) is used, the value returned by the rotation angle attribute is validated to be the multiple of the rotation angle.

That is, when the rotation is 0 degrees, the welder aligns the parts and welds the parts together with standard conventions. Even when the angle is 90 degrees, the result is same.

On a flange with even number of (4,8,16) bolt holes, the orientation can still be considered 0 (not relevant).

Only when the angle is odd, for example, 22 degree, it needs to be listed in the table.

If the value is 0 or multiple of the rotation angle with the number of bolt holes, the entry in the table and annotation corresponding to it can be excluded.

Input Objects

Input objects must be of the following types:

  • ThisObject: FactType ProductOccurrence.
  • Parameters corresponds to the context object.

    PortNumber = Integer 1,2,3,4 of the port (same order as publications in the tree).

Context Object Parameters

Parameter Name Type Read or Write Comments
FactType Any EKL type Type of ThisObject in the business rule body.
PortNumber Integer IN Input ports, 1,2,3,4 of the ports (same order as in the tree).
OrientationReference Integer OUT
  • -100 = loose flange, part is not to be listed.
  • -2 = part to model a weld (for example, legacy V5), part is not to be listed.
  • -1 = gasket, part is not to be listed.
  • 0 = port has no reference but part is to be listed. For example, a concentric reducer or a welded end of a stub end.
  • 1 = port has a zero reference angle. For example, a welded flange, a tee, or an elbow.
OrientationReference Real OUT

OrientationReference = real (default 0.0)

If non-zero angle is returned, for example, 45 degrees for a flange with 8 bolt holes, the rotation angle in the table is checked if it is a multiple of the RotationAngle (or 0.0) and if so it is not listed.

Sample

The following example describes how to define a recognizable orientation of a port on a part. Use the example to define the business rule in the resource set. As input to the BR is provided: VPMOccurrence of the Piping Part.

In most cases, it is sufficient to test the SubPartType of the part to determine if it has a fixed orientation. In rare cases, you need to take into account to the port number 1,2,3,4... to decide.

/*--------------------------------------------------------------------------*/
/* Rule name: CAAAITACPartOrientationBusinessRules1                         */ 
/*                                                                          */
/* Sample rule for defining if a port on a part has a recognizable          */
/* orientation. E.g. on a flange or a elbow this is the case.               */
/* But on a concentric reducer or a coupling this is not the case. In such  */
/* case a 0 can be returned so the software tries to find another part that */
/* serves as a reference in the relative orientation of the parts.          */
/*                                                                          */
/* For gaskets, -1 is to be returned, so it does not appear in orientation  */
/* table at all.                                                            */
/*                                                                          */
/*   Data may be read from attributes on the Part reference or by accessing */
/*   a customer knowlegde resource setup table.                             */
/*--------------------------------------------------------------------------*/

Let PartOcc(ProductOccurrence)
Let PartRef(VPMReference)
Let PartIns(VPMInstance)
let PipingPartObject(Piping_Part)

/* part reference data */
Let strPartType(String)
Let strPartSubType(String)
Let iReference(Integer)
Let iPortNumber(Integer)

/* initialize */
PartOcc=NULL
PartRef=NULL
PartIns=NULL
strPartSubType= " "
strPartType=" "
iReference=1


/* ThisObject information */
Trace(1,"ThisObject : " + ThisObject.Name)

/* Get the Part occurrence */
Set PartOcc = ThisObject
Trace(1,"Part Occurrence : " + PartOcc.Name)

/* Get the Part instance */
Set PartIns = PartOcc
Trace(1,"Part Instance : " + PartIns.Name)

/* Get the Part reference */
Set PartRef = PartIns.Reference
Trace(1,"Part Reference: " + PartRef.Name)

/* Get the piping part reference */
set PipingPartObject  = ThisObject.Reference
if( PipingPartObject<>NULL ){
  strPartType = PipingPartObject.PrimaryType.Name
  Trace(1,"PartType: " + strPartType)
}

/* Get the port that is tested */
iPortNumber = Parameters -> GetAttributeInteger("PortNumber"  )
Trace(1,"Port Number: " + iPortNumber )

/* Read the attributes from the Part (sample, customer dependent) */
strPartSubType=PartRef.GetAttributeString("V_SubPartType")
Trace(1,"SubPartType: "+strPartSubType )

/* Check if it is not a port which has no orientation */
if(strPartSubType == "Concentric Reducer" ){
    iReference=0
}
else if(strPartSubType == "Flange Loose" ){
    iReference=0
}

/* check if it is not as gasket */
if(strPartType == "Piping_Gasket"  OR  strPartSubType=="Gasket" ){
    iReference=-1
}

/* check if it is not a a weld */
if(strPartSubType == "Weld"){
    iReference=-2
}

/* Check if it is not a loose part which has no useable rotation at all */
if(strPartSubType == "Lapped Flange" ){
    iReference=-100
}

/* Output the result back to the calling code */

Parameters -> SetAttributeInteger("OrientationReference"  , iReference)

Trace(1,"Result Orientation rule : "+iReference )

/* end   */