Skip to content

Reinforcement

Reinforcement bars

  • Bending shape

    To create rebar reinforcement you will need a bending shape first. Learn more in this article

  • Placement

    In the second step, you will be placing the rebar. In other words, you need to create a placement. Learn more in this article

Rebar classes relationships

The relationships between classes related to rebar reinforcement are shown on the UML diagram below. The key takeaways are:

  • All the classes representing rebar placement inherits from the AllplanElement class, which means that they can be used to create rebars in the drawing file.
  • You can apply information to them, that are common for all elements, like attributes, layer, pen, stroke or color.
  • Almost all the placement classes are composed by the BendingShape. This is logical, since this class defines the shape of the bar we want to place
  • Helper classes, offered by the PythonPart framework to construct the shapes and placements more easily, are not shown on the diagram to keep it legible. Refer to the articles about placement and shape definition to learn about them.
classDiagram 
direction BT

class AllplanElement{
    <<Abstract>>
    +CommonProperties CommonProperties
    +Attributes Attributes
}
class ReinfElement{
    <<Abstract>>
}
class BarPlacement{
    int positionNumber
    BendingShape BendingShape
    BendingShape EndBendingShape
    Matrix3D BendingShapeMatrix
    Point3D StartPoint
    Point3D EndPoint
    Vector3D DistanceVector
    Line3D RotationAxis

    GetBarCount() int
    SetLabel()
}
class CircularAreaElement{
    int positionNumber
    int steelGrade
    Line3D RotationAxis
    Polyline3D contourPoints
    float outerAngleStart
    float outerAngleEnd
    float innerAngleStart
    float innerAngleEnd

    SetOverlap()
    SetBarProperties()
}
class ExtrudeBarPlacement{
    int PositionNumber
    Path3D path
    float crossBarDistance

    AddCrossBendingShape()
    AddLongitudinalBarProp()
    Extrude()
}
class SweepBarPlacement{
    int PositionNumber
    Path3DList paths
    float crossBarDistance

    AddSectionBars()
}
class LongitudinalBarProperties{
    BendingShape shape
    float overlappingLength
    float startLength
}
class BendingShape{
    float Diameter
    int steelGrade
    BendingShapeType bendingShapeType
    float hookLengthStart
    float hookAngleStart
    HookType hookTypeStart
    float hookLengthEnd
    float hookAngleEnd
    HookType hookTypeEnd
    VecDoubleList BendingRoller
    Polyline3D ShapePolyline
}
class HookType{
    <<Enumeration>>
    eAnchorage
    eAngle
    eStirrup
}
class BendingShapeType{
    <<Enumeration>>
}

ReinfElement --|> AllplanElement
BarPlacement --|> ReinfElement
ExtrudeBarPlacement --|> ReinfElement
SweepBarPlacement --|> ReinfElement
CircularAreaElement --|> ReinfElement
LongitudinalBarProperties "*" --o ExtrudeBarPlacement
BendingShape "1-2" --o BarPlacement
BendingShape "*" --o ExtrudeBarPlacement
BendingShape "*" --o SweepBarPlacement
BendingShape "1" --o LongitudinalBarProperties
HookType "2" --o BendingShape
BendingShapeType "1" --o BendingShape

Read access

All the data specific to a rebar reinforcement, that exists in a drawing file, can be read from the BaseElementAdapter. Before we get into details, you need to be aware of what adapter type you are accessing. Here are the types you may encounter and what they are representing:

Adapter type Representing...
BarsRepresentationLine_TypeUUID the polyline of a single rebar in a certain UVS
BarsRepresentation_TypeUUID1 all the polylines of a placement in a certain UVS
BarsLinearPlacement_TypeUUID the placement itself (regardless of the UVS)
BarsDefinition_TypeUUID the rebar position

Tip

To check the type, call GetElementAdapterType(), e.g. like:

>>> element_adapter.GetElementAdapterType().GetTypeName()
'BarsRepresentationLine_TypeUUID'

In the database, these elements are organized in a hierarchy shown on the diagram below. Note the cardinalities: a parent element can have one or more children, but a child can have only one parent. This is logical, as e.g. the same rebar shape (BarsDefinition) can be placed multiple times with BarsLinearPlacement.

erDiagram
    BarsDefinition_TypeUUID ||--|{ BarsLinearPlacement_TypeUUID : "has"
    BarsLinearPlacement_TypeUUID ||--|{ BarsRepresentation_TypeUUID : "has"
    BarsRepresentation_TypeUUID ||--|{ BarsRepresentationLine_TypeUUID : "has"

Warning

When the element adapter is a result of selection, its type may depend on where the selection was done! E.g. in a plan view (or UVS) you'll get BarsRepresentationLine_TypeUUID and in an isometric view, you'll get BarsLinearPlacement_TypeUUID1.

Tip

You can use the ParentElementService and ChildElementsService to go through the hierarchy and get the adapter you really need.

Now, once you know what element adapters you may encounter, here are the ways of how you can use them to access the reinforcement related data:

  1. Using the BarPositionData class. This gives you information related to the bending shape, such as mark number, diameter or total count. We recommend you to perform this on an element adapter of type BarsDefinition_TypeUUID

    Example

    Construct the object from the BaseElementAdapter and then read its properties:

    >>> bar_position_data = AllplanReinforcement.BarPositionData(element_adapter)
    >>> print(f"Mark number: {bar_position_data.Position}\n"
    ...       f"Count:       {bar_position_data.Count}\n"
    ...       f"Length:      {bar_position_data.Length}\n")
    Mark number: 1
    Count:       10
    Length:      6000.00
    
  2. Calling GetElement() on an element adapter of type BarsLinearPlacement_TypeUUID1 will give you the BarPlacement object with all the data related to the placement.

    Info

    Because it is a general function, not specific to reinforcement, we describe the implementation in detail in a separate article.

    When you obtain the BarPlacement object this way, bear the following in mind:

    • The object does not contain the information about the start and end point of a placement. Both GetStartPoint() and GetEndPoint() methods will give you the origin (0,0,0).
    • The polyline of the BendingShape is located in its local coordinate system. Especially, if the same bending shape is used by multiple placements in a drawing file.
    • By calling GetPlacementMatrix() you can obtain a transformation matrix that transforms the bending shape from local to global coordinate system. This way you can obtain the geometry of the first rebar in a placement:

      bar_placement = AllplanBaseElements.GetElement(element_adapter)
      bending_shape = bar_placement.BendingShape
      local_to_global = bar_placement.GetPlacementMatrix()
      bending_shape.Transform(local_to_global)
      first_rebar_polyline = bending_shape.ShapePolyline
      

  1. In the case of a linear placement. Other placements (rotational, polygonal, etc...) will have different types. 

Placeholder