General InformationThis 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:
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 ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe 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 */ |