Building & Civil Resources

This topic provides an overview of the Building and Civil Resources resource table in Data Setup and the resources used by Building & Civil Assemblies. A resource is a PLM object (for example, a catalog or a business rule) or another type of file (for example, a bitmap or a spreadsheet).

This page discusses:

The xml files from the directories indicated below are used when there are no files referenced in Data Setup.
Logical Name Resource Type Mandatory Criteria Description
Supported Standards XML Document

available in win_b64\startup\Civil\aecstd

- Defines the supported standards.
Building Information Modeling Definition XML Document

available in win_b64\resources\standard\aec

- Defines the IFC/OmniClass/UniFormat extensions that can be set on Building & Civil objects.

Provides the list of IFC/OmniClass/UniFormat extensions that can be assigned to Building & Civil objects at creation. Also provides the list of extensions that can be added manually by the designer during edition.

Important:
  • You can either modify xml files or create new ones by adding customized extensions to be available at creation or in edition.
  • For more information about adding "customized" extensions" see Model Specialization Management User Guide: Creating and Editing an Extension.

Alignment Design Rules Definition XML Document

available in win_b64\resources\standard\aec

- Defines the design rules to check an alignment definition.
Alignment Design Customization XML Document

available in win_b64\resources\standard\aec

- Customizes the behavior of alignment features.
Building Information Modeling Customization Know-how component

available in win_b64\startup\Civil\BIM\

- Defines the customized extensions that can be set on Building and Civil features.
Concrete Design Customization XML Document

available in win_b64\startup\Civil\ConcreteDesign

- - Customizes the behavior of concrete features.
Rebar Shape Code Computation Business Rule

available in win_b64\startup\Civil\ConcreteDesign\ConcreteRebarShapeCode_BS.CATRule

- - Enables the shape code computation, or override a previous shape code computation.
Road attainment methods Business Rule

available in win_b64\resources\knowledge\scripts

- - Defines the road attainment methods.
Railway attainment methods Business Rule

available in win_b64\resources\knowledge\scripts

- - Defines the railway attainment methods.
Railway cant and transition length rules Business Rule

available in win_b64\resources\knowledge\scripts

- - Defines the railway cant and transition length values.
BIM Attribute Completion Business Rule win_b64\resources\knowledge\scripts -

The script (BIMAttributeCompletionRule_Sample.CATRule) of the Runtime View will be read,

  • if the rule is UNSET in Data Setup
  • or if the rule is SET and the Fact Type contains"Any Value".

Script files are located in the following runtime view directory: <os>\resources\knowledge\scripts.

The script (BIMAttributeCompletionRule_Sample.CATRule ) of the Data Setup will be read, if the rule is SET and if the Fact Type contains the "VPMReference" value.

Defines the BIM Attribute Completion behavior.

From the BIM Completeness dialog box, the missing attributes of Civil Engineering objects are automatically defined/computed through the script of the Business Rules, and set directly in the BIM Attributes panel.

About Building & Civil Resources

The xml files from the directories indicated in the table above are used when there are no files referenced in Data Setup.

A building & civil resource is an XML document that describes building and civil objects along with their expected behaviors at creation and in edition mode. Sample files are available in win_b64\resources\standard\aec or win_b64\resources\knowledge\scripts. You can modify the xml files of interest by specifying values for AddAtCreation and AtEdition attributes for each extension (Yes or No) or you can add customized extensions in a new xml file. The extract below shows an example for the IfcPset_ChimneyCommon extension.

Note: For more information, see About Adding Customized Extensions in Building & Civil Assemblies.

XML File Example

 <BusinessObject name = "AecDoor">
    <BaseExtensions>
      <BaseExtension default = "true" exposed = "true" name = "IfcDoor"/>
      <BaseExtension exposed = "true" name = "IfcDoorStandardCase"/>
    </BaseExtensions>
    <Extension level = "100" name = "OmniClass"/>
    <Extension level = "100" name = "UniFormatBuilding"/>
    <Extension deletable = "true" exposed = "true" level = "100" name = "IfcPset_DoorCommon"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_DoorWindowGlazingType"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_DoorWindowShadingType"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_ConcreteElementGeneral"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_PrecastConcreteElementFabrication"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_PrecastConcreteElementGeneral"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_Condition"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_EnvironmentalImpactIndicators"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_EnvironmentalImpactValues"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_ManufacturerOccurrence"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_ManufacturerTypeInformation"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_PackingInstructions"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_ServiceLife"/>
    <Extension deletable = "true" level = "300" name = "IfcPset_Warranty"/>
    <Extension deletable = "true" exposed = "true" level = "100" name = "IfcQto_DoorBaseQuantities"/>
  </BusinessObject>

Description of XML Elements

The table below describes elements and their possible attributes.

Element Attribute (s) Description
BusinessObject name Specifies whether an extension is to be added if not present.
BaseExtensions
  • default
  • exposed
  • name
A base extension is assigned to a type of object (created with the object). When there are two base extensions, they are exclusive. At least one base extension is mandatory, with a combination of
  • default: when there are two base extensions, only one is set to true. The default attribute allows to determine which base extension will be used. In the user interface, you can switch to the other base extension with the BIM Manager editor.
  • exposed exposes a base extension as a parameter set. The PLM attributes are exposed as parameters in the 3D shape. You can use these parameters to modify geometry.
Extension
  • deletable
  • exposed
  • level
  • name
An extension is assigned to a type of object, with a combination of
  • deletable when set to true, it means that you can delete the extension.
  • exposed exposes an extension as a parameter set. The PLM attributes are exposed as parameters in the 3D shape. You can use these parameters to modify geometry.
  • level: the value corresponds to the Level Of Development (LOD). If the value is equal to100, the extension is assigned to Building & Civil object at creation. If the value is over 100, the extension will not be visible and can be added manually by the designer in the user interface.
  • name corresponds to the Ifc extension.

With the BIM Completeness command, you can check extensions according to the given LOD above, and identify the lacks of information (attributes). You can also analyze the mockup from a global point of view within the Building & Civil Assemblies app.

Supported Standards

Example of Supported Standards
standards version="1">  
<standard name="IFC4" activated="true"/>  
<standard name="OmniClass_Table_11" activated="false"/>  
<standard name="OmniClass_Table_12" activated="false"/>  
<standard name="OmniClass_Table_13" activated="false"/>  
<standard name="OmniClass_Table_14" activated="false"/>  
<standard name="OmniClass_Table_21" activated="false"/>  
<standard name="OmniClass_Table_22" activated="false"/>  
<standard name="OmniClass_Table_23" activated="false"/>  
<standard name="OmniClass_Table_31" activated="false"/>  
<standard name="OmniClass_Table_32" activated="false"/>  
<standard name="OmniClass_Table_33" activated="false"/>  
<standard name="OmniClass_Table_34" activated="false"/>  
<standard name="OmniClass_Table_35" activated="false"/>  
<standard name="OmniClass_Table_36" activated="false"/>  
<standard name="OmniClass_Table_41" activated="false"/>  
<standard name="OmniClass_Table_49" activated="false"/>  
<standard name="Uniformat_II_Elemental_Classification" activated="false"/>  
<standard name="Proposed_Uniformat_II_Bridge_Elements" activated="false"/>
</standards>

Alignment Design Rules Definition

Example of Radius Table
<Alignments> 

    <!-- ********************* -->
    <!--      Radius Tables    -->  
    <!-- ********************* -->  

    <RadiusTables>

        <!--   Sample Radius Table by speed values   -->        


          <RadiusTable Name="DefaultRadiusBySpeed">      
           <HorizontalRadiusTable>        
             <Radius Speed="40km_h"  Minimum="40m"/>        
             <Radius Speed="60km_h"  Minimum="120m"/>        
             <Radius Speed="80km_h"  Minimum="240m"/>        
             <Radius Speed="100km_h" Minimum="400m"/>        
             <Radius Speed="120km_h" Minimum="665m"/>      
           </HorizontalRadiusTable>
           <VerticalRadiusTable>        
             <CrestRadiusTable>
               <Radius Speed="40km_h"  Minimum="500m"/>          
               <Radius Speed="60km_h"  Minimum="1500m"/>
               <Radius Speed="80km_h"  Minimum="3000m"/>
               <Radius Speed="100km_h" Minimum="6000m"/>
               <Radius Speed="120km_h" Minimum="12000m"/>
             </CrestRadiusTable>   
             <SagRadiusTable>
                <Radius Speed="40km_h"  Minimum="700m"/>          
                <Radius Speed="60km_h"  Minimum="1500m"/>          
                <Radius Speed="80km_h"  Minimum="2200m"/>          
                <Radius Speed="100km_h" Minimum="3000m"/>  
                <Radius Speed="120km_h" Minimum="4200m"/>        
                </SagRadiusTable>      
             </VerticalRadiusTable>    
      </RadiusTable>        

         <!--  Sample Radius Table by category values  -->    

            <RadiusTable Name="DefaultRadiusByCategory">    
               <HorizontalRadiusTable>        
                  <Radius Category="R60"  Minimum="120m"/>        
                  <Radius Category="R80"  Minimum="240m"/>        
                  <Radius Category="T80"  Minimum="240m"/>        
                  <Radius Category="T100" Minimum="425m"/>
              </HorizontalRadiusTable>      
              <VerticalRadiusTable>        
                <CrestRadiusTable>          
                  <Radius Category="R60"  Minimum="1500m"/>          
                  <Radius Category="R80"  Minimum="3000m"/>          
                  <Radius Category="T80"  Minimum="3000m"/>          
                  <Radius Category="T100" Minimum="6000m"/>  
                 </CrestRadiusTable>        
                 <SagRadiusTable>          
                   <Radius Category="R60"  Minimum="1500m"/>          
                   <Radius Category="R80"  Minimum="2200m"/>          
                   <Radius Category="T80"  Minimum="2200m"/>          
                   <Radius Category="T100" Minimum="3000m"/>        
                 </SagRadiusTable>      
               </VerticalRadiusTable>    
              </RadiusTable>
        </RadiusTables>
Design Rules: Example of Length Table

<!-- ********************* --> 
 <!--    Length Tables      -->
 <!-- ********************* -->
  <LengthTables>

      <!--   Sample Length Table by speed values   -->    

      <LengthTable Name="DefaultLengthBySpeed">      
        <HorizontalLengthTable>        
          <LineLengthTable>          
              <Length Speed="40km_h"  Minimum="110m"/>          
              <Length Speed="60km_h"  Minimum="150m"/>          
              <Length Speed="80km_h"  Minimum="210m"/>          
              <Length Speed="100km_h"  Minimum="260m"/>          
              <Length Speed="120km_h"  Minimum="280m"/>        
             </LineLengthTable>        
             <ArcLengthTable>
               <Length Speed="40km_h"  Minimum="40m"/>          
               <Length Speed="60km_h"  Minimum="50m"/>          
               <Length Speed="80km_h"  Minimum="70m"/>          
               <Length Speed="100km_h"  Minimum="90m"/>          
               <Length Speed="120km_h"  Minimum="110m"/>        
             </ArcLengthTable>        
             <TransitionLengthTable>          
               <Length Speed="40km_h"  Minimum="40m"/>          
               <Length Speed="60km_h"  Minimum="50m"/>          
               <Length Speed="80km_h"  Minimum="70m"/>          
               <Length Speed="100km_h"  Minimum="90m"/>          
               <Length Speed="120km_h"  Minimum="110m"/>        
             </TransitionLengthTable>      
            </HorizontalLengthTable>      
             <VerticalLengthTable>
                <LineLengthTable>          
                   <Length Speed="40km_h"  Minimum="110m"/>          
                   <Length Speed="60km_h"  Minimum="150m"/>          
                   <Length Speed="80km_h"  Minimum="210m"/>          
                   <Length Speed="100km_h"  Minimum="260m"/>          
                   <Length Speed="120km_h"  Minimum="280m"/>        
                </LineLengthTable> 
             <CrestParabolaLengthTable>
                <Length Speed="50km_h" Minimum="150m"/>
                <Length Speed="70km_h" Minimum="200m"/>
                <Length Speed="90km_h" Minimum="250m"/>
                <Length Speed="110km_h" Minimum="300m"/>
             </CrestParabolaLengthTable >
             <SagParabolaLengthTable >
                <Length Speed="50km_h" Minimum="120m"/>
                <Length Speed="70km_h" Minimum="180m"/>
                <Length Speed="90km_h" Minimum="220m"/>
                <Length Speed="110km_h" Minimum="260m"/>
            </SagParabolaLengthTable >
         </VerticalLengthTable>    
      </LengthTable>  
   </LengthTables>

Design Rules: Example of Gradient Table

<!-- ********************* -->
<!--    Gradient Tables    -->  
<!-- ********************* -->  

<GradientTables>    

  <!--   Sample Gradient Table by speed values   -->    
  <GradientTable Name="DefaultGradientBySpeed">      
     <Gradient Speed="40km_h"  Maximum="7%"/>      
     <Gradient Speed="60km_h"  Maximum="7%"/>      
     <Gradient Speed="80km_h"  Maximum="6%"/>      
     <Gradient Speed="100km_h" Maximum="5%"/>      
     <Gradient Speed="120km_h" Maximum="5%"/>    
   </GradientTable>

   <!--   Sample Gradient Table by category values   -->    

   <GradientTable Name="DefaultGradientByCategory">      
      <Gradient Category="R60"  Maximum="7%"/>      
      <Gradient Category="R80"  Maximum="6%"/>      
      <Gradient Category="T80"  Maximum="6%"/>      
      <Gradient Category="T100" Maximum="5%"/>    
      </GradientTable>  
</GradientTables>

Design Rules: Example of Superelevation Table

Superelevation attainment methods can be defined in a dedicated Business Rule called Alignment superelevation rules available the Building & Civil Resources resource table.

The script below is a stationing script. If no XML resource file is set in Data Setup, the AlignmentDesign.xml file delivered in startup\Civil\AlignmentDesign is used.

When you create a new alignment superelevation rule and assign it to a resource, the resource's input "ThisObject" must be set to "AECAlignment3D" type.

<SuperelevationTables>
  <SuperelevationTable Name="MySuperelevationTable">
    <SuperelevationDesignSpeed Speed="20km_h">
      <Superelevation Radius="75m" tLength="15m" eRate="2.2%"/>
      <Superelevation Radius="51m" tLength="16m" eRate="2.4%"/>
      <Superelevation Radius="38m" tLength="18m" eRate="2.6%"/>
      <Superelevation Radius="30m" tLength="19m" eRate="2.8%"/>
      <Superelevation Radius="24m" tLength="20m" eRate="3%"/>
      <Superelevation Radius="20m" tLength="22m" eRate="3.2%"/>
      <Superelevation Radius="17m" tLength="23m" eRate="3.4%"/>
      <Superelevation Radius="14m" tLength="24m" eRate="3.6%"/>
      <Superelevation Radius="12m" tLength="26m" eRate="3.8%"/>
      <Superelevation Radius="8m" tLength="27m" eRate="4%"/>
      </ SuperelevationDesignSpeed >
    </SuperelevationTable
  <SuperelevationTables>

where:
Element Description
Speed (input) Corresponds to the design speed defined in Alignment. The speed value defined in Alignment must match precisely the attribute value Speed defined in the XML design rules. Otherwise the matching table containing rule values will not be found. For example: Ex: if Alignment design speed = 25km/h, no table will be found since parameter Speed = 20km/h.
Radius (input) Corresponds to the curve radius as per Alignment geometries. If the radius of alignment curve does not match precisely the attribute value Radius, for safety reason the closest lower radius value will always be selected. For example: if curve radius = 28m, select a node the attribute value of which is Radius =24m.
tLength (output) Corresponds to the transition length.
eRate Corresponds to the superelevation rate.
Design Rules: Example of Horizontal Radius Tables Depending on Superelevation Rate

<RadiusTable Name="MyRadiusTableSpeed">
      <HorizontalRadiusTable eRate="2%">>
        <Radius Speed="50km_h" Minimum="86m"/>
        <Radius Speed="70km_h" Minimum="203m"/>
        <Radius Speed="80km_h" Minimum="280m"/>
        <Radius Speed="90km_h" Minimum="375m"/>
        <Radius Speed="100km_h" Minimum="492m"/>
      </HorizontalRadiusTable>
      <HorizontalRadiusTable eRate="3%">
        <Radius Speed="50km_h" Minimum="78m"/>
        <Radius Speed="70km_h" Minimum="186m"/>
        <Radius Speed="80km_h" Minimum="240m"/>
        <Radius Speed="90km_h" Minimum="322m"/>
        <Radius Speed="100km_h" Minimum="415m"/>
      </HorizontalRadiusTable>
   </RadiusTable>

Design Rule: Example of Cant Design Table

<CantTables>
  <CantTable Name="MyCantTable">
    <CantDesignSpeed Speed="20km_h">
      <Cant radius="90m" Cant="5mm" tLength="5m"/>
    </CantDesignSpeed>
  </CantTable>
  <CantTable Name="MyCantTableByFormula" formulaId="France">
<CantTables>

where:
Element Description
Speed (input) Designs speed defined in Alignment.
Radius (input) Corresponds to curve radius as per Alignment geometries.
tLength (ouput) Corresponds to transition length.
Cant (ouput) Corresponds to superelevation rate.
formulaId (input) Corresponds to identifier to switch from a formula to another one in dedicated Business rule (see next paragraph).

If no Design Rules are set in Data Setup, default cant tables are provided in startup\Civil\AlignmentDesignRules\RailwayAlignmentDesignRules_Default.xml and are used by default.

Alignment Design Customization

The script below is a stationing script. If no XML resource file is set in Data Setup, the AlignmentDesign.xml file delivered in startup\Civil\AlignmentDesign is used.

<AlignmentDesign>

  <Units>
     <DefaultValues>
       <!-- Default values are used while creating a new alignment, road/railway surface, road/railway design -->
       <!-- Ulterior Data Setup modifications do not impact existing entities -->
       <Speed value="km_h"/> <!--km_h, mph-->
       <Gradient value="%_angle"/> <!--%_angle, m_m, deg, rad, grad, in_ft--> <!-- NOT USED -->
       <Superelevation value="%_angle"/> <!--%_angle, m_m, deg, rad, grad, in_ft-->
       <Cant value="%_angle"/> <!--%_angle, m_m, deg, rad, grad, in_ft--> <!-- NOT USED -->
       <CrossSection>
         <SmallAngle value="%_angle"/> <!--%_angle, m_m, deg, rad, grad, in_ft-->
         <LargeAngle value="m_m"/> <!--%_angle, m_m, deg, rad, grad, in_ft-->
         <LimitSmallLarge value="20%_angle"/>
       </CrossSection>
     </DefaultValues>
   </Units>
  <General>
	<AutomaticCreation>
		<VerticalInflectionPoint value ="true"/>
	</AutomaticCreation>
  </General> 
  <Stationings>
    <!-- Default values are used while creating a new alignment or the first stationing -->
    <!-- Ulterior Data Setup modifications do not impact existing alignments or stationings -->
    <DefaultValues>
      <MajorInterval value="100m"/>
      	<!-- Can be expressed in any length unit e.g. "100 feet"-->
      <MinorInterval value="20m"/>
      <!-- Can be expressed in any length unit e.g. "100 feet"-->
      <StationTextHeightRatio value="0.02"/>
      <!-- Expressed as a ratio of the MajorInterval-->
      <StationOffsetRatio value="1"/>
<!-- Offset between the alignment and the station text. Expressed as a ratio of TextHeight -->
    </DefaultValues>
    <!-- Global values are shared among all alignments contained in a given PLM representation -->
    <!-- They are stored in this representation during the first alignment creation -->
    <!-- Ulterior Data Setup modifications do not impact PLM representations in which alignments were already created -->
    <GlobalValues>
       <!-- Alignment -->
      <LockIntervals value="false"/>
      <!-- true: Major\Minor intervals parameter cannot be edited -->
						<!-- Numbers -->
      <LengthDecimalPlaces value="3"/>
      <LengthDisplayTrailingZeros value="false"/>
      <!-- Station annotation -->
      <StationTailRatio value="1"/>
      <!-- Expressed as a ratio of the TextHeight -->
      <StationOverrunRatio value="1"/>
      <!-- Expressed as a ratio of the TextHeight -->
      <!-- Station equation annotation -->
      <StationEquationBackLabel value="@unset"/>
      <!-- @unset to have an internationalized value equivalent to 'BACK' -->
      <StationEquationAheadLabel value="@unset"/>
      <!-- @unset to have an internationalized value equivalent to 'AHEAD' -->
      <StationEquationSideOffsetRatio value="1"/>
      <!-- Expressed as a ratio of the TextHeight -->
      <StationEquationTailRatio value="1"/>
      <!-- Expressed as a ratio of the TextHeight -->
      <StationEquationOverrunRatio value="1"/>
      <!-- Expressed as a ratio of the TextHeight -->
    </GlobalValues>
  </Stationings>
</AlignmentDesign>
where:
Element Description
MajorInterval Corresponds to the major interval of stationing at alignment creation. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
MinorInterval Corresponds to the minor interval of stationing at alignment creation. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationTextHeightRatio Corresponds to the text height at alignment creation. Expressed as a ratio of the major interval value. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept. For example, it could be 0.02, which results in a text height of 2m if the major interval is set to 100m.
StationOffsetRatio Corresponds to the distance between the station name and the alignment. Expressed as a ratio of the text height. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
LockIntervals Locks/unlocks the edition of minor and major intervals at 3D Shape level. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
LenghtDecimalPlaces Gives the number of significant decimals for stations.
LenghtDisplayTrailingZeros Displays trailing zeros for stations.
StationTailRatio Corresponds to the length of the station annotation beyond the alignment (i.e. the opposite side of the text). This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationOverrunRatio Corresponds to the length of the station annotation from the alignment (i.e. on the side of the text). This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationEquationBackLabel Corresponds to the back label at first stationing point creation. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationEquationAheadLabel Corresponds to the ahead label at first stationing point creation. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationEquationSideOffsetRatio Corresponds to the distance between the equation texts and the line perpendicular to the alignment. This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationEquationTailRatio Corresponds to the length of the station equation annotation beyond the alignment (i.e. the opposite side of the text). This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
StationEquationTailRatio Corresponds to the length of the station equation annotation beyond the text (i.e. on the side of the text). This value is stored on the alignment when creating this alignment. It is not updated if the value is modified later in Data Setup. The value used at creation is kept.
Speed Corresponds to the speed value of the vehicle on the infrastructure.
Gradient Corresponds to the longitudinal slope of the alignment.
Superelevation Corresponds to the Superelevation value for roads.
Cant Corresponds to the Cant value for railways.
CrossSection Corresponds to the CrossSection value for ditches, filling and excavation. The unit is chosen according to the angle value.

Concrete Design Customization

Example of Concrete Design Customization
<ConcreteDesign>
	
	<Numberings>

		<!-- Rounding values are used in numbering and report -->
		<RoundingValues>
			<!-- Use Rounding -->
			<UseRounding value="true"/>
			<!-- true: calculated lengths are rounded with following parameters  -->
			<!-- false: calculated lengths keep their exact values -->

			<!-- Dimension Rounding Direction  -->
			<DimensionRoundingDirection value="nearest"/>
			<!-- Acceptable values are up, down and nearest"-->

			<!-- Total Length Rounding Direction  -->
			<TotalLengthRoundingDirection value="nearest"/>
			<!-- Acceptable values are up, down and nearest"-->

			<DimensionRoundingAccuracy value="5mm"/>
			<!-- Can be expressed in any length unit e.g. "1 feet"-->

			<TotalLengthRoundingAccuracyForBVBS value="10mm"/>
			<!-- Can be expressed in any length unit e.g. "1 feet"-->

			<DimensionRoundingAccuracyForBVBS value="1mm"/>
			<!-- Can be expressed in any length unit e.g. "1 feet"-->

			<TotalLengthRoundingAccuracy value="25mm"/>
			<!-- Can be expressed in any length unit e.g. "1 feet"-->

			<ToleranceForLengthComparison value="0.1mm"/>
			<!-- Can be expressed in any length unit e.g. "1 feet"-->

			<ToleranceForAngleComparison value="0.5deg"/>
			<!-- Can be expressed in any angle unit e.g. "1 radian"-->
		</RoundingValues>

		<!-- Numbering values are used in numbering -->
		<NumberingValues>
			<!-- Adaptive Layers -->
			<AdaptiveLayersIndividually value="true"/>
			<!-- true: Number bars individually else Number bars as a whole -->

			<!-- true: Numbering uses letter for prefix; false : Numbering uses number for prefix -->
			<UseAlphabeticalPrefix value="true"/>

			<!-- true: in adaptive layer, bar set will be numbered using numbers. False : bar set will be numbered using letters -->
			<!-- only used is AdaptiveLayersIndividually is FALSE -->
			<NumberBarAlphabetically value="false"/>

			<!--Prefix For Coupler-->
			<PrefixForCoupler value="(C)"/>
			<!--Prefix added to the layer bar mark symbolizing the coupler relation-->
		</NumberingValues>

		<!-- Numbering display -->
		<Display>
			<!-- Separator used for display between Group and Number -->
			<Separator value="."/>

			<AdaptiveLayers>
				<!-- Option to group similar bars if true, no group otherwise -->
				<GroupSimilarBars value="false"/>
				<!-- Separator used for display between Start and End values -->
				<Separator value="-"/>
			</AdaptiveLayers>
		</Display>

	</Numberings>
	<Design>
		<DefaultValues>
			<!-- Default covering value for initialization  -->
			<DefaultCoveringValue value="30mm"/>
			<!-- Default concrete for initialization (C25,C30...)-->
			<DefaultConcreteName value=""/>
		</DefaultValues>
		<Display>
			
			<!-- Separator used for display between angle values for hook-->
			<AngleSeparator value="_"/>
		</Display>

	</Design>
	
	<!--Tolerance for merging bar element in report-->
	<Report>
		<MergeTolerances>
			<!--If a bar element is shorter than this tolerance, it will be merge with the following bar element-->
			<ToleranceLengthForFusionInReport value="2mm"/>

			<!--If two consecutive bar elements are circular arcs, the first one will be merge with the second if
		- the difference (in abs value) is less than ToleranceRadiusForFusionInReport  AND
		- the distance between their centers is less than ToleranceCenterForFusionInReport-->
			<ToleranceRadiusForFusionInReport value="2mm"/>

			<ToleranceCenterForFusionInReport value="50mm"/>

			<!--if the radius of a circular wire element is greater than the layer bending radius
			plus TolGapBetweenBendAndHoop, it is considered as a hoop
			Otherwise, it is considered as a bend-->
			<TolGapBetweenBendAndHoop value="1mm"/>
		</MergeTolerances>
	</Report>

</ConcreteDesign>

Rebar Shape Code Computation

/*================================================================================
/* ConcreteRebarShapeCode_BS.CATRule					                
/*												
/* Compute of the bar shape code according to the British Standard (BS 8666:2005)
/* User can customize this file for each project.					
/*												
/* ================================================================================
/*   
/*												
/* ===============================================================================

/* Parameters */


let input(AECRebarLayer)

set input = ThisObject
/*Global var*/
let AreAllBarsIdentical(Boolean)
let BarDiameter(Length)
let BarLength(Length)
let i, NbBars(Integer)

/*tols*/
let tol_for_length(LENGTH)
let tol_for_angle(ANGLE)

/*output*/
let BendingShapeCodes(List)

/*Retrieve tol*/
tol_for_length = input.GetLengthTolerance()
tol_for_angle = input.GetAngularTolerance()



/*Globals*/
AreAllBarsIdentical = input.AreAllBarsIdentical()
NbBars = input.GetNumberOfBars()
BarLength = input.GetAttributeReal("BarLength")*1m
BarDiameter = input.GetAttributeReal("Physical diameter")*1m

if (AreAllBarsIdentical == true)
{
	NbBars = 1
}
i=1



for i while i <= NbBars
{
	let IsPlanar(Boolean)
	let nb_segments, nb_arcs(Integer)
	
	let BarElements(List)
	let bar_geo(AECRebarSingleBar)
	let CurrentSC(Integer)
	let IsHelix (Boolean)
    
	CurrentSC = 99
	
    set bar_geo = input.GetBar(i)
    set IsHelix = bar_geo.GetAttributeBoolean("IsAnHelix")
	set nb_segments = bar_geo.GetAttributeInteger("NbSegments")
	set nb_arcs = bar_geo.GetAttributeInteger("NbArcs")
	set BarElements = bar_geo.GetAttributeObject("BarElements")
	set IsPlanar = bar_geo.GetAttributeBoolean("IsPlanar")
	
    
    if (IsHelix == true)
	{
		CurrentSC = 77
	}
	else if (IsPlanar == true)
	{
		let NbElements(Integer)
		set NbElements = BarElements.Size()
		
        if(NbElements == 1 and nb_arcs == 1)
        {
            /*FIXME!!!*/
            let BarElem(AECRebarSingleBarSection)
            let BarAngle(Angle)

            set BarElem=BarElements[1] 
            BarAngle = BarElem.GetAttributeReal("Angle")*1deg

            if(BarAngle < 180deg - tol_for_angle)
            {
                CurrentSC = 67
            }
            else
            {
                CurrentSC = 75
            }
            
        }
		else if (NbElements == 1 and nb_segments == 1)
		{
			let BarElem(AECRebarSingleBarSection)
			let BarVec(Vector)
			let currentBarLength(LENGTH)
			set BarElem=BarElements[1]
			
			CurrentSC = 0
			/*shape code depend on bar length*/
			
			set currentBarLength = BarElem.GetAttributeReal("BarLength")*1mm
			
            if (abs(currentBarLength - BarLength) < tol_for_length)
			{
				CurrentSC = 1
			}
		}
		else if(nb_segments == 2 and nb_arcs == 1)
		{
			let BarElem(AECRebarSingleBarSection)
			let BarRadius(Length)
			let BarAngle(Angle)
			set BarElem=BarElements[2]
			
			set BarRadius = BarElem.GetAttributeReal("Radius")*1mm
			set BarAngle = BarElem.GetAttributeReal("Angle")*1deg	
			
			
			/*make sure it is circular*/
			if(BarRadius > 0mm)
			{
				/*right angle ?*/
				if(abs(BarAngle - 90deg) < tol_for_angle or abs(BarAngle - (-90deg)) < tol_for_angle)
				{
					let BarElemPrev, BarElemNext(AECRebarSingleBarSection)
					let A, B, Threshold(Length)
					let VecBarPrevious, VecBarNext(Vector)
					
					set BarElemPrev = BarElements[1]
					set BarElemNext = BarElements[3]
					
                    set Threshold = BarRadius + 6 * BarDiameter
					
					set A = BarElemPrev.GetAttributeReal("BarLength")*1mm + BarRadius
					set B = BarElemNext.GetAttributeReal("BarLength")*1mm + BarRadius
					
                    
					
					if (A < Threshold or B < Threshold)
					{
						CurrentSC = 11
					}
					else
					{
						CurrentSC = 12
					}
					
				}
				else if( abs(BarAngle - 180deg) < tol_for_angle )
				{
					CurrentSC = 13
				}
				else if( ( BarAngle > 0 and BarAngle < 90deg - tol_for_angle ) or ( BarAngle < 0 and BarAngle > -90deg + tol_for_angle) )
				{
					CurrentSC = 15
				}
				else if( ( BarAngle > 0 and BarAngle > 90deg + tol_for_angle ) or ( BarAngle < 0 and BarAngle < -90deg - tol_for_angle) )
				{
					CurrentSC = 14
				}
			}	
		}
		else if(nb_segments == 3 and nb_arcs == 2)
		{
			let BarElem1, BarElem2(AECRebarSingleBarSection)
			let BarRadius1, BarRadius2(Length)
			let BarAngle1, BarAngle2(Angle)
			set BarElem1=BarElements[2]
			set BarElem2=BarElements[4]
			
			set BarRadius1 = BarElem1.GetAttributeReal("Radius")*1mm
			set BarAngle1 = BarElem1.GetAttributeReal("Angle")*1deg	
			
			set BarRadius2 = BarElem2.GetAttributeReal("Radius")*1mm
			set BarAngle2 =  BarElem2.GetAttributeReal("Angle")*1deg	
			
			
			if((abs(BarAngle1 - 90deg) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle ) or (abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle))
			{
				CurrentSC = 21
			}
			
			else if((abs(BarAngle1 - 180deg) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle ) or 
                (abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - 180deg) < tol_for_angle) or
                (abs(BarAngle2 - 180deg) < tol_for_angle and abs(BarAngle1 - 90deg) < tol_for_angle ) or 
                (abs(BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle1 - 180deg) < tol_for_angle))
			{
				CurrentSC = 22
			}
			
			else if((abs(BarAngle1 - 90deg) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle ) or 
                (abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle))
			{
				CurrentSC = 23
			}
            else if(( BarAngle1 > 0 and BarAngle2 > 0 and BarAngle1 < 90deg - tol_for_angle and BarAngle2 < 90deg - tol_for_angle) or 
                ( BarAngle1 < 0 and BarAngle2 < 0 and BarAngle1 > -90deg + tol_for_angle and BarAngle2 > -90deg + tol_for_angle))
			{
                let TotalAngle(Angle)
                TotalAngle = abs(BarAngle1) + abs(BarAngle2)
                if (abs(TotalAngle - 90deg) < tol_for_angle)
                {
                    CurrentSC = 24
                }
                else
                {
                        CurrentSC = 25
                }
				
			}

            
            else if(( BarAngle1 > 0 and BarAngle2 < 0 and BarAngle1 < 90deg - tol_for_angle and BarAngle2 > -90deg + tol_for_angle) or 
                ( BarAngle1 < 0 and BarAngle2 > 0 and BarAngle1 > -90deg + tol_for_angle and BarAngle2 < 90deg + tol_for_angle))
                {
                    if(abs(BarAngle1 + BarAngle2) < tol_for_angle)
                    {
                        CurrentSC = 26
                    }
                    
                }

            else if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle1 < 90deg - tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle) or 
                (BarAngle1 > 0 and BarAngle2 > 0 and BarAngle2 < 90deg - tol_for_angle and abs(BarAngle1 - 90deg) < tol_for_angle) or
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle1 > -90deg + tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle2 > -90deg + tol_for_angle and abs(BarAngle1 - (-90deg)) < tol_for_angle))
                {
                        CurrentSC = 27
                }

            else if((BarAngle1 > 0 and BarAngle2 < 0 and BarAngle1 < 90deg - tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 > 0 and BarAngle2 < 90deg - tol_for_angle and abs(BarAngle1 - (-90deg)) < tol_for_angle) or
                (BarAngle1 < 0 and BarAngle2 > 0 and BarAngle1 > -90deg + tol_for_angle and abs(BarAngle2 - (90deg)) < tol_for_angle) or 
                (BarAngle1 > 0 and BarAngle2 < 0 and BarAngle2 > -90deg + tol_for_angle and abs(BarAngle1 - (90deg)) < tol_for_angle))
                {
                        CurrentSC = 28
                }

            else if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle1 < 90deg - tol_for_angle and BarAngle2 > 90deg + tol_for_angle) or 
                (BarAngle1 > 0 and BarAngle2 > 0 and BarAngle2 < 90deg - tol_for_angle and BarAngle1 > 90deg + tol_for_angle) or
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle1 < -90deg - tol_for_angle and BarAngle2 > -90deg + tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle2 < -90deg - tol_for_angle and BarAngle1 > -90deg + tol_for_angle))
                {
                       if(abs(abs(BarAngle1 + BarAngle2) - 180deg) < tol_for_angle)
                        {
                            CurrentSC = 29
                        }
                }
            

                

            
		}
        else if(nb_segments == 4 and nb_arcs == 3)
		{
            let BarElem1, BarElem2, BarElem3(AECRebarSingleBarSection)
			let BarAngle1, BarAngle2, BarAngle3(Angle)
			set BarElem1=BarElements[2]
			set BarElem2=BarElements[4]
            set BarElem3=BarElements[6]
			
			set BarAngle1 = BarElem1.GetAttributeReal("Angle")*1deg	
			set BarAngle2 = BarElem2.GetAttributeReal("Angle")*1deg
            set BarAngle3 = BarElem3.GetAttributeReal("Angle")*1deg

            if((abs(BarAngle1 - 90deg) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle and abs(BarAngle3 - 90deg) < tol_for_angle) or 
                (abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle3 - (-90deg)) > tol_for_angle))
			{
				CurrentSC = 31
			}

            if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle3 < 0 and abs(BarAngle1 - 90deg) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle and abs(BarAngle3 - (-90deg)) < tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle3 > 0 and abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle3 - 90deg) > tol_for_angle) or 
                (BarAngle3 > 0 and BarAngle2 > 0 and BarAngle1 < 0 and abs(BarAngle3 - 90deg) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle and abs(BarAngle1 - (-90deg)) < tol_for_angle) or 
                (BarAngle3 < 0 and BarAngle2 < 0 and BarAngle1 > 0 and abs(BarAngle3 - (-90deg)) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle1 - 90deg) > tol_for_angle))
			{
				CurrentSC = 32
			}

            if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle3 > 0 and abs(BarAngle1 - 180deg) < tol_for_angle and abs(BarAngle2 - 180deg) < tol_for_angle and abs(BarAngle3 - 180deg) < tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle3 < 0 and abs(BarAngle1 - (-180deg)) < tol_for_angle and abs(BarAngle2 - (-180deg)) < tol_for_angle and abs(BarAngle3 - (-180deg)) > tol_for_angle))
			{
                let Bar1, Bar2, FirstSegment, LastSegment(AECRebarSingleBarSection)
                let BarLength1, BarLength2, FirstSegmentLength, LastSegmentLength, ArcRadius1, ArcRadius2, ArcRadius3(Length)
                set Bar1 = BarElements[3]
                set Bar2 = BarElements[5]
                set FirstSegment = BarElements[1]
                set LastSegment = BarElements[BarElements.Size()]
                set ArcRadius1 = BarElem1.GetAttributeReal("Radius")*1mm
                set ArcRadius2 = BarElem2.GetAttributeReal("Radius")*1mm
                set ArcRadius3 = BarElem3.GetAttributeReal("Radius")*1mm
                BarLength1 = Bar1.GetAttributeReal("BarLength")*1mm
                BarLength2 = Bar2.GetAttributeReal("BarLength")*1mm
                FirstSegmentLength = FirstSegment.GetAttributeReal("BarLength")*1mm
                LastSegmentLength = LastSegment.GetAttributeReal("BarLength")*1mm

                
                /* TODO : add radius check */
                if(abs(BarLength1 - BarLength2) < tol_for_length and abs(FirstSegmentLength - LastSegmentLength ) < tol_for_length and abs(ArcRadius1 - ArcRadius2) < 11mm and abs(ArcRadius1 - ArcRadius3) < 11mm)
                {
                    CurrentSC = 33
                }
				
			}

            if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle3 < 0 and abs(BarAngle1 - 90deg) < tol_for_angle and BarAngle2 < 90deg - tol_for_angle and BarAngle3 > -90deg + tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle3 > 0 and abs(BarAngle1 - (-90deg)) < tol_for_angle and BarAngle2 > -90deg + tol_for_angle and BarAngle3 < 90deg - tol_for_angle) or 
                (BarAngle3 > 0 and BarAngle2 > 0 and BarAngle1 < 0 and abs(BarAngle3 - 90deg) < tol_for_angle and BarAngle2 < 90deg - tol_for_angle and BarAngle1 > -90deg + tol_for_angle) or 
                (BarAngle3 < 0 and BarAngle2 < 0 and BarAngle1 > 0 and abs(BarAngle3 - (-90deg)) < tol_for_angle and BarAngle2 > -90deg + tol_for_angle and BarAngle1 < 90deg - tol_for_angle))
			{
				CurrentSC = 34
			}

             if((BarAngle1 > 0 and BarAngle2 < 0 and BarAngle3 > 0 and BarAngle1 < 90deg - tol_for_angle and BarAngle2 > -90deg + tol_for_angle and abs(BarAngle3 - 90deg) < tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 > 0 and BarAngle3 < 0 and BarAngle1 > -90deg + tol_for_angle and BarAngle2 < 90deg - tol_for_angle and abs(BarAngle3 - (-90deg)) < tol_for_angle) or 
                (BarAngle3 > 0 and BarAngle2 < 0 and BarAngle1 > 0 and BarAngle3 < 90deg - tol_for_angle and BarAngle2 > -90deg + tol_for_angle and abs(BarAngle1 - 90deg) < tol_for_angle) or 
                (BarAngle3 < 0 and BarAngle2 > 0 and BarAngle1 < 0 and BarAngle3 > -90deg + tol_for_angle and BarAngle2 < 90deg - tol_for_angle and abs(BarAngle1 - (-90deg)) < tol_for_angle))
			{
				CurrentSC = 35
			}

            if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle3 > 0 and abs(BarAngle1 - 90deg ) <  tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle and BarAngle3 < 90deg - tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle3 < 0 and abs(BarAngle1 - (-90deg) ) <  tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and BarAngle3 > -90deg + tol_for_angle) or 
                (BarAngle3 > 0 and BarAngle2 > 0 and BarAngle1 > 0 and abs(BarAngle3 - 90deg ) <  tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle and BarAngle1 < 90deg - tol_for_angle) or 
                (BarAngle3 < 0 and BarAngle2 < 0 and BarAngle1 < 0 and abs(BarAngle3 - (-90deg) ) <  tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and BarAngle1 > -90deg + tol_for_angle))
			{
				CurrentSC = 36
			}
        }
        else if(nb_segments == 5 and nb_arcs == 4)
		{
            let BarElem1, BarElem2, BarElem3, BarElem4(AECRebarSingleBarSection)
			let BarRadius1, BarRadius2, BarRadius3, BarRadius4(Length)
			let BarAngle1, BarAngle2, BarAngle3, BarAngle4(Angle)
			set BarElem1=BarElements[2]
			set BarElem2=BarElements[4]
            set BarElem3=BarElements[6]
            set BarElem4=BarElements[8]
			
			set BarRadius1 = BarElem1.GetAttributeReal("Radius")*1mm
			set BarAngle1 = BarElem1.GetAttributeReal("Angle")*1deg	
			
			set BarRadius2 = BarElem2.GetAttributeReal("Radius")*1mm
			set BarAngle2 =  BarElem2.GetAttributeReal("Angle")*1deg

            set BarRadius3 = BarElem3.GetAttributeReal("Radius")*1mm
			set BarAngle3 =  BarElem3.GetAttributeReal("Angle")*1deg

            set BarRadius4 = BarElem4.GetAttributeReal("Radius")*1mm
			set BarAngle4 =  BarElem4.GetAttributeReal("Angle")*1deg

            
             if((abs(BarAngle1 - 90deg) < tol_for_angle and abs(BarAngle2 - 90deg) < tol_for_angle and abs(BarAngle3 - 90deg) < tol_for_angle and abs(BarAngle4 - 90deg) < tol_for_angle) or 
                (abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle3 - (-90deg)) > tol_for_angle and abs(BarAngle4 - (-90deg)) > tol_for_angle))
			{
				CurrentSC = 41
			}

            else if((abs(BarAngle1 - 90deg) < tol_for_angle and abs(BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle3 - (-90deg)) < tol_for_angle and abs(BarAngle4 - 90deg) < tol_for_angle) or 
                (abs(BarAngle1 - (-90deg)) < tol_for_angle and abs(BarAngle2 - (90deg)) < tol_for_angle and abs(BarAngle3 - (90deg)) > tol_for_angle and abs(BarAngle4 - (-90deg)) > tol_for_angle))
			{
				CurrentSC = 44
			}

            
            else if((BarAngle1 > 0 and BarAngle2 < 0 and BarAngle3 <0 and BarAngle4 > 0 and BarAngle1 < 90deg - tol_for_angle and BarAngle2 > (-90deg) + tol_for_angle and BarAngle3 > (-90deg) + tol_for_angle and BarAngle4 < 90deg - tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 > 0 and BarAngle3 >0 and BarAngle4 < 0 and BarAngle1 > -90deg + tol_for_angle and BarAngle2 < (90deg) - tol_for_angle and BarAngle3 < (90deg) - tol_for_angle and BarAngle4 > -90deg + tol_for_angle))
			{
                if(abs(BarAngle1 - BarAngle4) < tol_for_angle and abs(BarAngle2 - BarAngle3) < tol_for_angle)
                {
                    let Bar1, Bar2(AECRebarSingleBarSection)
                    let BarLength1, BarLength2(Length)
                    set Bar1 = BarElements[3]
                    set Bar2 = BarElements[7]
                    BarLength1 = Bar1.GetAttributeReal("BarLength")*1mm
                    BarLength2 = Bar2.GetAttributeReal("BarLength")*1mm
                    if(abs(BarLength1 - BarLength2) < tol_for_length)
                    {
                            CurrentSC = 46
                    }
                    
                }
				
			}

            else if((BarAngle1 > 0 and BarAngle2 > 0 and BarAngle3 > 0 and BarAngle4 > 0 and abs( BarAngle1 - 180deg ) < tol_for_angle and abs( BarAngle2 - 90deg) < tol_for_angle and abs(BarAngle3 - 90deg) < tol_for_angle and abs(BarAngle4 -180deg ) < tol_for_angle) or 
                (BarAngle1 < 0 and BarAngle2 < 0 and BarAngle3 < 0 and BarAngle4 < 0 and abs( BarAngle1 - (-180deg) ) < tol_for_angle and abs( BarAngle2 - (-90deg)) < tol_for_angle and abs(BarAngle3 - (-180deg)) < tol_for_angle and abs(BarAngle4 - (-180deg) ) < tol_for_angle))
			{
                let BarSegment1, BarSegment2(AECRebarSingleBarSection)
                let BarLength1, BarLength2(Length)
                set BarSegment1 = BarElements[3]
                set BarSegment2 = BarElements[7]

                BarLength1 = BarSegment1.GetAttributeReal("BarLength")*1mm
                BarLength2 = BarSegment2.GetAttributeReal("BarLength")*1mm

                if(abs(BarLength1 - BarLength2) < tol_for_length)
                {
                    let FirstSegment, LastSegment(AECRebarSingleBarSection)
                    let FirstSegmentLength, LastSegmentLength(Length)
                    set FirstSegment = BarElements[1]
                    set LastSegment = BarElements[BarElements.Size()]
                    FirstSegmentLength = FirstSegment.GetAttributeReal("BarLength")*1mm
                    LastSegmentLength = LastSegment.GetAttributeReal("BarLength")*1mm

                    if(FirstSegmentLength < BarLength1 and LastSegmentLength < BarLength1 and abs(FirstSegmentLength - LastSegmentLength) < tol_for_length)
                    {
                        CurrentSC = 47
                    }

                    
                }

				
			}
        }
        else if(nb_segments == 6 and nb_arcs == 5)
		{
            let FirstBend, LastBend(AECRebarSingleBarSection)
            let FirstBendAngle, LastBendAngle(Angle)
			set FirstBend=BarElements[2]
			set LastBend=BarElements[BarElements.Size() - 1]
            
			set FirstBendAngle = FirstBend.GetAttributeReal("Angle")*1deg
			set LastBendAngle = LastBend.GetAttributeReal("Angle")*1deg	

            
			
			if((abs(FirstBendAngle - 90deg) < tol_for_angle and abs(LastBendAngle - 90deg) < tol_for_angle))
            {
                let InternalBend1, InternalBend2, InternalBend3(AECRebarSingleBarSection)
                let InternalAngle1, InternalAngle2, InternalAngle3(Angle)
                set InternalBend1=BarElements[4]
                set InternalBend2=BarElements[6]
                set InternalBend3=BarElements[8]
        
                set InternalAngle1 = InternalBend1.GetAttributeReal("Angle")*1deg
                set InternalAngle2 = InternalBend2.GetAttributeReal("Angle")*1deg	
                set InternalAngle3 = InternalBend3.GetAttributeReal("Angle")*1deg	

                
                if(abs(InternalAngle1 - 90deg) < tol_for_angle and abs(InternalAngle2 - 90deg) < tol_for_angle and abs(InternalAngle3 - 90deg) < tol_for_angle )
                {
                    /*check lengths*/
                    let FirstSegment, SegmentSide11, SegmentSide12, SegmentSide21, SegmentSide22, LastSegment(AECRebarSingleBarSection)
                    let FirstSegmentLength, LSegmentSide11, LSegmentSide12, LSegmentSide21, LSegmentSide22, LastSegmentLength(Length)
                    set SegmentSide11 = BarElements[3]
                    set SegmentSide12 = BarElements[7]
                    set SegmentSide21 = BarElements[5]
                    set SegmentSide22 = BarElements[9]
                    set FirstSegment = BarElements[1]
                    set LastSegment = BarElements[BarElements.Size()]

                    FirstSegmentLength = FirstSegment.GetAttributeReal("BarLength")*1mm
                    LSegmentSide11 = SegmentSide11.GetAttributeReal("BarLength")*1mm
                    LSegmentSide12 = SegmentSide12.GetAttributeReal("BarLength")*1mm
                    LSegmentSide21 = SegmentSide21.GetAttributeReal("BarLength")*1mm
                    LSegmentSide22 = SegmentSide22.GetAttributeReal("BarLength")*1mm
                    LastSegmentLength = LastSegment.GetAttributeReal("BarLength")*1mm

                    
                    if(abs(LSegmentSide11 - LSegmentSide12) < tol_for_length and abs(LSegmentSide21 - LSegmentSide22) < tol_for_length and 
                        FirstSegmentLength < LSegmentSide11 and LastSegmentLength < LSegmentSide21 and 
                        FirstSegmentLength < LSegmentSide21 and LastSegmentLength < LSegmentSide11 and 
                        abs(FirstSegmentLength - LastSegmentLength) < tol_for_length)
                    {
                                CurrentSC = 51                      
                    }
                }
                else if((InternalAngle1 > 0 and InternalAngle2 > 0 and InternalAngle3 > 0 and InternalAngle1 > 90deg + tol_for_length and InternalAngle2 < 90deg - tol_for_angle and abs(InternalAngle3 - 90deg) < tol_for_angle) or
                (InternalAngle1 > 0 and InternalAngle2 > 0 and InternalAngle3 > 0 and InternalAngle1 < 90deg - tol_for_length and InternalAngle2 > 90deg + tol_for_angle and abs(InternalAngle3 - 90deg) < tol_for_angle))
                {
                    /*check lengths*/
                    let FirstSegment, SegmentSide1, SegmentSide2, LastSegment(AECRebarSingleBarSection)
                    let FirstSegmentLength, LSegmentSide1, LSegmentSide2, LastSegmentLength(Length)
                    set FirstSegment = BarElements[1]
                    set SegmentSide1 = BarElements[3]
                    set SegmentSide2 = BarElements[9]
                    set LastSegment = BarElements[BarElements.Size()]

                    FirstSegmentLength = FirstSegment.GetAttributeReal("BarLength")*1mm
                    LSegmentSide1 = SegmentSide1.GetAttributeReal("BarLength")*1mm
                    LSegmentSide2 = SegmentSide2.GetAttributeReal("BarLength")*1mm
                    LastSegmentLength = LastSegment.GetAttributeReal("BarLength")*1mm

                    if(FirstSegmentLength < LSegmentSide1 and LastSegmentLength < LSegmentSide1 and
                    FirstSegmentLength < LSegmentSide2 and LastSegmentLength < LSegmentSide2 and
                    abs(FirstSegmentLength - LastSegmentLength) < tol_for_length )
                    {
                        CurrentSC = 56
                    }
                }
            }

            else if((abs(FirstBendAngle - (-90deg)) < tol_for_angle and abs(LastBendAngle -(-90deg)) < tol_for_angle ))
            {
                let InternalBend1, InternalBend2, InternalBend3(AECRebarSingleBarSection)
                let InternalAngle1, InternalAngle2, InternalAngle3(Angle)
                set InternalBend1=BarElements[4]
                set InternalBend2=BarElements[6]
                set InternalBend3=BarElements[8]
        
                set InternalAngle1 = InternalBend1.GetAttributeReal("Angle")*1deg
                set InternalAngle2 = InternalBend2.GetAttributeReal("Angle")*1deg	
                set InternalAngle3 = InternalBend3.GetAttributeReal("Angle")*1deg	

                
                if(abs(InternalAngle1 - (-90deg)) < tol_for_angle and abs(InternalAngle2 - (-90deg)) < tol_for_angle and abs(InternalAngle3 - (-90deg)) < tol_for_angle )
                {
                    /*check lengths*/
                    let FirstSegment, SegmentSide11, SegmentSide12, SegmentSide21, SegmentSide22, LastSegment(AECRebarSingleBarSection)
                    let FirstSegmentLength, LSegmentSide11, LSegmentSide12, LSegmentSide21, LSegmentSide22, LastSegmentLength(Length)
                    set SegmentSide11 = BarElements[3]
                    set SegmentSide12 = BarElements[7]
                    set SegmentSide21 = BarElements[5]
                    set SegmentSide22 = BarElements[9]
                    set FirstSegment = BarElements[1]
                    set LastSegment = BarElements[BarElements.Size()]

                    FirstSegmentLength = FirstSegment.GetAttributeReal("BarLength")*1mm
                    LSegmentSide11 = SegmentSide11.GetAttributeReal("BarLength")*1mm
                    LSegmentSide12 = SegmentSide12.GetAttributeReal("BarLength")*1mm
                    LSegmentSide21 = SegmentSide21.GetAttributeReal("BarLength")*1mm
                    LSegmentSide22 = SegmentSide22.GetAttributeReal("BarLength")*1mm
                    LastSegmentLength = LastSegment.GetAttributeReal("BarLength")*1mm

                    
                    if(abs(LSegmentSide11 - LSegmentSide12) < tol_for_length and abs(LSegmentSide21 - LSegmentSide22) < tol_for_length and 
                        FirstSegmentLength < LSegmentSide11 and LastSegmentLength < LSegmentSide21 and 
                        FirstSegmentLength < LSegmentSide21 and LastSegmentLength < LSegmentSide11 and 
                        abs(FirstSegmentLength - LastSegmentLength) < tol_for_length)
                    {
                                CurrentSC = 51                      
                    }
                }
                else if((InternalAngle1 < 0 and InternalAngle2 < 0 and InternalAngle3 < 0 and InternalAngle1 < -90deg - tol_for_length and InternalAngle2 > -90deg + tol_for_angle and abs(InternalAngle3 - (-90deg)) < tol_for_angle) or
                (InternalAngle1 < 0 and InternalAngle2 < 0 and InternalAngle3 < 0 and InternalAngle1 > -90deg + tol_for_length and InternalAngle2 < -90deg - tol_for_angle and abs(InternalAngle3 - (-90deg)) < tol_for_angle))
                {
                    /*check lengths*/
                    let FirstSegment, SegmentSide1, SegmentSide2, LastSegment(AECRebarSingleBarSection)
                    let FirstSegmentLength, LSegmentSide1, LSegmentSide2, LastSegmentLength(Length)
                    set FirstSegment = BarElements[1]
                    set SegmentSide1 = BarElements[3]
                    set SegmentSide2 = BarElements[9]
                    set LastSegment = BarElements[BarElements.Size()]

                    FirstSegmentLength = FirstSegment.GetAttributeReal("BarLength")*1mm
                    LSegmentSide1 = SegmentSide1.GetAttributeReal("BarLength")*1mm
                    LSegmentSide2 = SegmentSide2.GetAttributeReal("BarLength")*1mm
                    LastSegmentLength = LastSegment.GetAttributeReal("BarLength")*1mm

                    if(FirstSegmentLength < LSegmentSide1 and LastSegmentLength < LSegmentSide1 and
                    FirstSegmentLength < LSegmentSide2 and LastSegmentLength < LSegmentSide2 and
                    abs(FirstSegmentLength - LastSegmentLength) < tol_for_length )
                    {
                        CurrentSC = 56
                    }
                }
            }
        }
        else if(nb_segments == 7 and nb_arcs == 6)
		{
            let iArc, NbRightRightAnglePos, NbRightRightAngleNeg(Integer)
            
            NbRightRightAnglePos = 0
            NbRightRightAngleNeg = 0
            iArc=0
            for iArc while iArc < nb_arcs
            {
                let Elem(AECRebarSingleBarSection)
                let ElemAngle(Angle)
                set Elem = BarElements[2*iArc+2]
                set ElemAngle = Elem.GetAttributeReal("Angle")*1deg

                if(abs(ElemAngle - 90deg) < tol_for_angle)
                {
                    NbRightRightAnglePos = NbRightRightAnglePos + 1
                }
                if(abs(ElemAngle - (-90deg)) < tol_for_angle)
                {
                    NbRightRightAngleNeg = NbRightRightAngleNeg + 1
                }

                iArc = iArc + 1
            }

            
            if(NbRightRightAnglePos == 6 or NbRightRightAngleNeg == 6)
            {
                /*check length*/
                /*for now, impossible to check C == D*/

                

                let CElem, DElem, AElem, BElem, AElem2, BElem2(AECRebarSingleBarSection)
                let LCElem, LDElem, LAElem, LBElem, LA2Elem, LB2Elem(Length)
                set CElem = BarElements[1]
                set DElem = BarElements[BarElements.Size()]
                set AElem = BarElements[3]
                set BElem = BarElements[5]
                set AElem2 = BarElements[7]
                set BElem2 = BarElements[9]



                LCElem = CElem.GetAttributeReal("BarLength") * 1mm
                LDElem = DElem.GetAttributeReal("BarLength") * 1mm
                LAElem = AElem.GetAttributeReal("BarLength") * 1mm
                LBElem = BElem.GetAttributeReal("BarLength") * 1mm
                LA2Elem = AElem2.GetAttributeReal("BarLength") * 1mm
                LB2Elem = BElem2.GetAttributeReal("BarLength") * 1mm

                

                if(LCElem < LAElem and LCElem < LBElem and LDElem < LAElem and LDElem < LBElem and abs(LAElem - LA2Elem)*1mm < tol_for_length and abs(LBElem - LB2Elem)*1mm < tol_for_length)
                {
                    CurrentSC = 63
                }
                else
                {
                    CurrentSC = 64
                }
            }

           

        }
	}
    else
    {
        /*Check if frame*/
        if(nb_arcs == 4 and nb_segments == 5)
        {
            let BarSegment1, BarSegment2, BarSegment3, BarSegment4, BarSegment5(AECRebarSingleBarSection)
            let BarArc1, BarArc2, BarArc3, BarArc4(AECRebarSingleBarSection)
            let LengthBarSegment1, LengthBarSegment2, LengthBarSegment3, LengthBarSegment4, LengthBarSegment5(Length)
            let AngleBarArc1, AngleBarArc2, AngleBarArc3, AngleBarArc4(Angle)

            set BarSegment1 = BarElements[1]
            set BarArc1 = BarElements[2]
            set BarSegment2 = BarElements[3]
            set BarArc2 = BarElements[4]
            set BarSegment3 = BarElements[5]
            set BarArc3 = BarElements[6]
            set BarSegment4 = BarElements[7]
            set BarArc4 = BarElements[8]
            set BarSegment5 = BarElements[9]

            set AngleBarArc1 = BarArc1.GetAttributeReal("Angle")*1deg
            set AngleBarArc2 = BarArc2.GetAttributeReal("Angle")*1deg
            set AngleBarArc3 = BarArc3.GetAttributeReal("Angle")*1deg
            set AngleBarArc4 = BarArc4.GetAttributeReal("Angle")*1deg

            set LengthBarSegment1 = BarSegment1.GetAttributeReal("BarLength") * 1mm
            set LengthBarSegment2 = BarSegment2.GetAttributeReal("BarLength") * 1mm
            set LengthBarSegment3 = BarSegment3.GetAttributeReal("BarLength") * 1mm
            set LengthBarSegment4 = BarSegment4.GetAttributeReal("BarLength") * 1mm
            set LengthBarSegment5 = BarSegment5.GetAttributeReal("BarLength") * 1mm

            /*check angles*/
            if(abs(AngleBarArc1 - 90deg) < tol_for_angle and abs(AngleBarArc2 - 90deg) < tol_for_angle and abs(AngleBarArc3 - 90deg) < tol_for_angle and abs(AngleBarArc4 - 90deg) < tol_for_angle )
            {
                /*check length*/
                if(abs(LengthBarSegment2 - LengthBarSegment4) < tol_for_length)
                {
                    /*check orientation*/
                    let VecBarSegment1, VecBarSegment2, VecBarSegment3, VecBarSegment4, VecBarSegment5(Vector)
                    let Det1, Det2, Det3(Real)
                    VecBarSegment1 = [BarSegment1.GetAttributeReal("End_x") * 1mm - BarSegment1.GetAttributeReal("Start_x") * 1mm, BarSegment1.GetAttributeReal("End_y") * 1mm - BarSegment1.GetAttributeReal("Start_y") * 1mm, BarSegment1.GetAttributeReal("End_z") * 1mm - BarSegment1.GetAttributeReal("Start_z") * 1mm]
                    VecBarSegment2 = [BarSegment2.GetAttributeReal("End_x") * 1mm - BarSegment2.GetAttributeReal("Start_x") * 1mm, BarSegment2.GetAttributeReal("End_y") * 1mm - BarSegment2.GetAttributeReal("Start_y") * 1mm, BarSegment2.GetAttributeReal("End_z") * 1mm - BarSegment2.GetAttributeReal("Start_z") * 1mm]
                    VecBarSegment3 = [BarSegment3.GetAttributeReal("End_x") * 1mm - BarSegment3.GetAttributeReal("Start_x") * 1mm, BarSegment3.GetAttributeReal("End_y") * 1mm - BarSegment3.GetAttributeReal("Start_y") * 1mm, BarSegment3.GetAttributeReal("End_z") * 1mm - BarSegment3.GetAttributeReal("Start_z") * 1mm]
                    VecBarSegment4 = [BarSegment4.GetAttributeReal("End_x") * 1mm - BarSegment4.GetAttributeReal("Start_x") * 1mm, BarSegment4.GetAttributeReal("End_y") * 1mm - BarSegment4.GetAttributeReal("Start_y") * 1mm, BarSegment4.GetAttributeReal("End_z") * 1mm - BarSegment4.GetAttributeReal("Start_z") * 1mm]
                    VecBarSegment5 = [BarSegment5.GetAttributeReal("End_x") * 1mm - BarSegment5.GetAttributeReal("Start_x") * 1mm, BarSegment5.GetAttributeReal("End_y") * 1mm - BarSegment5.GetAttributeReal("Start_y") * 1mm, BarSegment5.GetAttributeReal("End_z") * 1mm - BarSegment5.GetAttributeReal("Start_z") * 1mm]

                    set VecBarSegment1 = VecBarSegment1 / VecBarSegment1.Norm()
                    set VecBarSegment2 = VecBarSegment2 / VecBarSegment2.Norm()
                    set VecBarSegment3 = VecBarSegment3 / VecBarSegment3.Norm()
                    set VecBarSegment4 = VecBarSegment4 / VecBarSegment4.Norm()
                    set VecBarSegment5 = VecBarSegment5 / VecBarSegment5.Norm()

                    set Det1 = ScalarProduct(CrossProduct(VecBarSegment1, VecBarSegment2), VecBarSegment3)
                    set Det2 = ScalarProduct(CrossProduct(VecBarSegment2, VecBarSegment3), VecBarSegment4)
                    set Det3 = ScalarProduct(CrossProduct(VecBarSegment3, VecBarSegment4), VecBarSegment5)
                    
                    
                    if(abs(Det1 - (-1)) < tol_for_length and abs(Det2) < tol_for_length and abs(Det3 - (-1)) < tol_for_length)
                    {
                        CurrentSC = 98
                    }

                    
                }
            }
        }
    }
	
	BendingShapeCodes.Append(CurrentSC)
	
	i = i + 1
}	


/* Write outputs */
Parameters.SetAttributeObject("AllBendingShapeCodes", BendingShapeCodes)

Railway Attainment Methods

/* ========================================================================== */
/* RailwayAttainmentMethods.CATRule                                           */
/*                                                                            */
/* Sample file to customize Railway attainment methods.      */
/* User can customize this file for each project.                             */
/*                                                                            */
/* ========================================================================== */
/* Defines formulae for the various transition lengths                        */
/* for attaining Cant														  */
/* Based on the following variables                                           */
/*    {l} - spiral length from geometry										  */
/*    {t} - transition length from table								      */
/*    {m} - maximum cant value on Tangent									  */
/*    {a} - applied cant for the curve										  */
/*    {p} - fractional part of transition length achieved before curve point  */
/* ========================================================================== */
/* Defines the following transition lengths (where approriate)                */
/*    LRtoFC - Level Rail to Full Cant                                        */
/*    LRtoBC - Level Rail to Beginning of Curve                               */
/* ========================================================================== */
/* Get inputs */Let l(real)Let t(real)Let m(real)Let a(real)Let p(real)l = Parameters.GetAttributeReal("sLength")t = 
   Parameters.GetAttributeReal("tLength")m = Parameters.GetAttributeReal("MaxCantOnTangent")a = 
   Parameters.GetAttributeReal("Cant")p = ThisObject.GetAttributeReal("TRate")
/* Compute outputs */Let LRtoFC(real)Let LRtoBC(real)if(l>0){	LRtoFC=l	LRtoBC=l*p}else { 	LRtoFC=t	if ( a>0 AND m>0) 
   {		Let threshold(real)		threshold=m/a		if(threshold<p ){			LRtoBC=t*threshold		}		else		{				LRtoBC=t*p		}	}	
   else 	{		LRtoBC=t*p	}}/* Write outputs */Parameters.SetAttributeReal("LRtoFC", 
   LRtoFC)Parameters.SetAttributeReal("LRtoBC", LRtoBC)

Railway Cant and Transition Length Rules

/* ========================================================================== */
/* RailwayCantAndTransitionLengthRules_Sample.CATRule                         */
/*                                                                            */
/* Sample file to calculat cant and transition length.						  */
/* User can customize this file for each project.                             */
/*                                                                            */
/* ========================================================================== */
/* Defines formulas for Cant and transition length.                           */
/* Based on the following variables                                           */
/*    {Id}    - formula identifier given by design rules                      */
/*               -"France": "China" and "CantDeficiency"                      */
/*                   Cant(mm)   = 6*Speed^2/radius                            */
/*                   tLength(m) = max(50,5.8*Speed*Speed*Speed/(180*radius))  */
/*               -"China":                                                    */
/*                   Cant(mm)   = 0.64*t*Speed*Speed/(3.6*3.6*g*radius)       */
/*                   tLength(m) = 0.01*Cant*Speed                             */
/*               -"CantDeficiency":                                           */
/*                   Cant(mm)   = ceil((eqCant-md)*2)/2                       */
/*                   tLength(m) = 0.012*cantDeficiency*Speed                  */
/*    {t}     - track width                                     (m)           */
/*    {s}     - current design speed                            (m/s)         */
/*    {r}     - Curve radius from geometry                      (m)           */
/*    {md}    - maximum allowable cant deficiency               (m)           */
/*    {me}    - maximum allowable cant excess                   (m)           */
/*    {smax}  - maximum speed                                   (m/s)         */
/*    {smin}  - minimum speed                                   (m/s)         */
/*    {g}     - gravity acceleration                            (m/s^2)       */
/* ========================================================================== */
/* Defines cant and transition length values				                  */
/*    cant    -   Applied cant for the curve                      (m)         */
/*    tLength -   Transition length                              (m)          */
/* ========================================================================== */
/* Get inputs */
Let Id  (String)
Let t   (real)Let s   (real)
Let r   (real)Let md  (real)
Let me  (real)Let smax(real)
Let smin(real)

Id    = Parameters.GetAttributeString("FormulaId")
t     = Parameters.GetAttributeReal("TrackWidth")
s     = Parameters.GetAttributeReal("Speed")
r     = Parameters.GetAttributeReal("Radius")
md    = Parameters.GetAttributeReal("MaxCantDeficiency")
me    = Parameters.GetAttributeReal("MaxCantExcess")
smax  = Parameters.GetAttributeReal("MaxSpeed")
smin  = Parameters.GetAttributeReal("MinSpeed")

/* Compute outputs */
Let cant(real)
Let tLength(real)

/* Local attributs */
Let	g   (real)    /*Gravity*/
Let eqCant(real)  /*Equilibrium cant*/
g=9.806

/* Convert Speeds in km_h*/
Let Speed(real)			
Let maxSpeed(Real)
Speed=s*3.6 
maxSpeed =smax*3.6

if(Id=="France"){	
    cant=round(6*Speed*Speed/r)/1000	
    tLength=round(max(10,5.8*Speed*Speed*Speed/(180*r)))
} 
else if (Id=="China")
{	
    cant=round(0.64*t*1000*Speed*Speed/(3.6*3.6*g*r))/1000	
    tLength=round(0.01*cant*1000*Speed)
}
else if(Id=="CantDeficiency") 
{		
    eqCant=round(t*1000*maxSpeed*maxSpeed/(127*r))/1000	
    cant=ceil((eqCant-md)*2000)/2000	

    Let cantDeficiency(real)	
    cantDeficiency=round(t*1000*maxSpeed*maxSpeed/(127*r))/1000-cant	

    tLength=round(0.012*cantDeficiency*1000*Speed)		
}
cant=max(cant,0.005)
tLength=max(tLength,5)

/* Write outputs */
Parameters.SetAttributeReal("Cant", cant)
Parameters.SetAttributeReal("tLength", tLength)

BIM Attribute Completion

You can customize the behavior of BIM attributes by giving them a value through a Business Rule in Data Setup.

To perform an automatic completion of missing IFC attributes in the BIM Attributes panel, you can use the BIM Completeness command that activates the BIM Attribute Completion Business Rule you have assigned to the Building & Civil Resources resource table. Several attributes can be defined/computed in BIM Attributes at the same time which saves time in design.

The Business Rule script below is an example. If no XML resource file is set in Data Setup, the BIMAttributeCompletionRule_Sample.CATRule file delivered in win_b64\resources\knowledge\scripts is used. There is a condition on the Slab Reference and Gross Volume Attributes in the script. Then the Gross Volume is computed and, its value and the slab reference are added in the corresponding attribute boxes in the BIM Attributes panel.

/* ========================================================================== */
/* BIMAttributeCompletionRule_Sample.CATRule                            	  */
/*                                                                         	  */
/* Sample file to automatize the completion of IFC attribute		          */
/*                                                                       	  */
/* ========================================================================== */
/* Based on the following variables                                   	      */
/*    {attributeName}                                                    	  */
/* ========================================================================== */
/* Defines attribute value													  */
/*    {attributeValue}												          */
/* ========================================================================== */


/* Get inputs */
Let attributeName (String)
attributeName = Parameters.GetAttributeString("AttributeName")

/* Write outputs */
if(attributeName=="IfcPset_SlabCommon_Reference"){
	(ThisObject:IfcPset_SlabCommon).IfcPset_SlabCommon_Reference="18.12.0456"
	Parameters.SetAttributeString("AttributeValue", "18.12.0456")
}

if(attributeName=="IfcQto_SlabBaseQuantities_GrossVolume"){	
	Let partBodyList(List)
	partBodyList = ThisObject ->Query("BodyFeature","x.Name like \"*PartBody*\"")

	if(partBodyList.Size() > 0)
	{
		Let volume(VOLUME)
		volume = smartVolume(partBodyList->GetItem(1)) 

		Let skeletonList(List)
		skeletonList = ThisObject ->Query("Feature","x.Name like \"*Skeleton Representation*\"")

		if(skeletonList.Size() > 0)
		{
			Let skeleton(Feature)
			skeleton = skeletonList->GetItem(1)
		
			Let childrenListParam(List)
			childrenListParam = skeleton->Query("AdvisorParameterSet","x.Name like \"Parameters*\"")
		
			Let paramSet(AdvisorParameterSet)
			paramSet = childrenListParam->GetItem(1)
		
			paramSet->SetAttributeReal("IfcQto_SlabBaseQuantities_GrossVolume",volume)
			Parameters.SetAttributeReal("AttributeValue", volume)

		}else{
			(ThisObject:IfcQto_SlabBaseQuantities).IfcQto_SlabBaseQuantities_GrossVolume=volume
			Parameters.SetAttributeReal("AttributeValue", volume)
		}
	}
}