Piping ISO/ORTHO, Piping Assembly, and HVAC Batches Annotation Rule (AITACSpoolAnnotationBusinessRules1)

An opening ID is an entry point used to customize business logic. The Piping ISO/ORTHO, Piping Assembly, and HVAC Batch annotation rule opening ID is used to create additional annotations on the piping parts and piping pipes.

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, Piping Assembly Isometrics, Piping Orthogonal Drawings, HVAC Orthogonal Spool Drawings commands.

Input mode:

  • 1=Spool Mode
  • 2=Spool Assembly Mode
  • 3=Orthogonal
  • 4=HVAC

You can retrieve the run mode with GetAttributeInteger from the business rule. Set Mode = Parameters->GetAttributeInteger("RunMode").

Note: This is an optional parameter to override the execution for each type of batch, in case if only single type of batch is used or the same result is applicable to all batches, or else run mode is not required.

The result is placed as a text annotation in the isometric projection view.

Alternatively, you can add a coordinate template name in the drawing profile to create a Multi-Discipline Drafting annotation.

Input Objects

Input objects must be of the following types:

  • ThisObject: FactType ProductOccurrence (=assembly occurrence).
  • 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 rule body.
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 on the Piping Spool Isometric.

2: Annotation on the Piping Spool Assembly.

3: Orthogonal

4: HVAC

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
CustomAnnotationRulesTemplate String name Name of the annotation element stored in the drafting annotation templates catalog chapter

Note: CustomAnnotationRulesTemplate is applicable only for orthogonal and HVAC batches.

Sample

The following sample describes the annotation rule for piping annotations. Use the sample to define the business rule in the resource set. As input to the BR will be provided: VPMOccurrence of the Rigid Pipe.

/* Rule created by bps1 1/21/2021 */ 

Let PipeOcc(ProductOccurrence)
Let PipeRef(VPMReference)
Let PipeIns(VPMInstance)
Let strAnnotation(String)
Let X(Real)
Let Y(Real)
Let Z(Real)
Let X1(Real)
Let Y1(Real)
Let Z1(Real)
Let Mode(Integer)


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

Set X1=X+50
Set Y1=Y+30
Set Z1=Z+40


Parameters -> SetAttributeReal("CoordinateX", X1)
Parameters -> SetAttributeReal("CoordinateY", Y1)
Parameters -> SetAttributeReal("CoordinateZ", Z1) 

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

/* Get the pipe occurrence */
Set PipeOcc = ThisObject
Trace(1,"Pipe Occurrence : " + PipeOcc.Name)

/* Get the pipe instance */
Set PipeIns = PipeOcc
Trace(1,"Pipe Instance : " + PipeIns.Name)

/* Get the pipe reference */
Set PipeRef = PipeIns.Reference
Trace(1,"Pipe Reference: " + PipeRef.Name)

X =round(X)
Y =round(Y)
Z =round(Z)

// place coordinate on each node
 strAnnotation = "" +  ToString(X) + ":"+ ToString(Y) + ":" +  ToString(Z)

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