Continuation Annotation Business Rule (AITACPipeOrientationBusinessRules1)

An opening ID is an entry point used to customize business logic. The Continuation Annotation business rule opening ID is used to create the required annotations in continuation.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked while using the Piping Spool Isometrics and Piping Assembly commands.

Input Objects

Input objects must be of the following types:

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

Context Object Parameters

Parameter Name Type Read or Write Comments
FactType Any EKL type — Type of ThisObject in the business rules body.
ConnectedObject String IN
  • Occurrence of connected object, empty if not found.
  • Extracted from string with GetAttributeObject.
CoordinateX Real IN Coordinate or piping node where the annotation leader is pointing.
CoordinateY Real IN Coordinate or piping node where the annotation leader is pointing.
CoordinateZ Real IN Coordinate or piping node where the annotation leader is pointing.
RunMode Integer IN 1: annotation is on the piping spool.

2: annotation is on the piping spool assembly.

Annotation String OUT String text to be placed on the new annotation, if the text is empty, the annotation is not created. Multiline text is supported.

Sample

The following sample describes the continuation annotation rule for piping annotations. Use the sample to define the business rules in the resource set. This example creates an annotation for each connected object, including its name and location, but does not create annotations for open ends without a connected object.

/*-----------------------------------------------------------------------------------------------------------------	*/
/* Continuation Annotation business sample rule:							*/
/*	-creates an annotation for each connected object, including its name and location,		*/
/*	-doesn't create annotations for open ends without a connected object.   				*/
/*												*/
/* Rule name: AITACPipeOrientationBusinessRules1							*/
/* 												*/
/* Context Object Parameters 									*/
/* ConnectedObject (String) Occurrence of connected object, empty if not found.                             		*/
/* CoordinateX (Real) Coordinate or piping node where annotation leader is pointing 			*/
/* CoordinateY (Real) Coordinate or piping node where annotation leader is pointing 			*/
/* CoordinateZ (Real) Coordinate or piping node where annotation leader is pointing 			*/
/* RunMode (Integer) 1: annotation is on piping spool, 2: annotation is on piping spool assembly 		*/
/* Annotation (String) String text to be placed on new annotation, if text is empty, 			*/
/* annotation will not be created. Multiline text is supported indicated as "|" 				*/
/*-----------------------------------------------------------------------------------------------------------------	*/
Let PipConnectedObject (ProductOccurrence)
Let PipeRef (VPMReference)

Let X (Real)
Let Y (Real)
Let Z (Real)
Let Mode (Integer)

Let strAnnotation (String)
Let strAnnotationConnectedPartName (String)

/* initialize */
strAnnotationConnectedPartName = ""
strAnnotation = ""

Set PipConnectedObject = Parameters->GetAttributeObject("ConnectedObject")
Set X = Parameters->GetAttributeReal("CoordinateX")
Set Y = Parameters->GetAttributeReal("CoordinateY")
Set Z = Parameters->GetAttributeReal("CoordinateZ")
Set Mode = Parameters->GetAttributeInteger("RunMode")

/* In case of connected object */
If PipConnectedObject <> NULL
{
	set PipeRef = PipConnectedObject.Reference
	if PipeRef <> NULL
	{
		/*connected object name on the first line */
		set strAnnotationConnectedPartName = PipeRef.Name
		strAnnotation = strAnnotationConnectedPartName

		/* And the connection point on a second line */
		X =round(X)
		Y =round(Y)
		Z =round(Z)
		strAnnotation = strAnnotation + "|" + ToString(X) + ":"+ ToString(Y) + ":" + ToString(Z)
	}
}

/* Output the result back to the calling code */
Parameters -> SetAttributeString("Annotation", strAnnotation)