[Domanda] Add hooks to BendingShape


Hi,
I need some advice how to approach issue with adding hooks to bars created via NemAll_Python_Reinforcement.BendingShape

The problem is that if I create stirrup like this:

        list_point = AllplanGeo.Point3DList()
        list_point.append(point_0)
        list_point.append(point_1)
        list_point.append(line_1.StartPoint)
        list_point.append(line_3.StartPoint)
        list_point.append(point_4)
        list_point.append(point_5)


        shape_polyline = AllplanGeo.Polyline3D(list_point)
        com_prop = AllplanSettings.AllplanGlobalSettings.GetCurrentCommonProperties()
     
        shape_bar = AllplanReinf.BendingShape(
                        shape_polyline,
                        AllplanUtil.VecDoubleList([0,0,0,0,0,0,0,0,0,0,]),#0
                        diameter,
                        -1,
                        -1,
                        AllplanReinf.BendingShapeType.Freeform,
                        diameter*10,
                        135,
                        AllplanReinf.HookType.eStirrup,
                        diameter*10,
                        135,
                        AllplanReinf.HookType.eStirrup
        )

The result looks like on screen (01_Handmade_hooks), unfortunately any changas to hooks made in property tab results in this (02_After_changes).

It removes part of stirrup and tries to create hooks - it make some sens as I suspect that allplan treats last bar legs as hooks so it recreates them. I figured out that if I create BendingShape without hooks and add them latter it should work fine, so:

        list_point = AllplanGeo.Point3DList()
        list_point.append(point_1)
        list_point.append(line_1.StartPoint)
        list_point.append(line_3.StartPoint)
        list_point.append(point_4)

        shape_polyline = AllplanGeo.Polyline3D(list_point)
        com_prop = AllplanSettings.AllplanGlobalSettings.GetCurrentCommonProperties()

        shape_bar = AllplanReinf.BendingShape(
                        shape_polyline,
                        AllplanUtil.VecDoubleList([0,0,0,0,0,0,0,0,0,0,]),#0
                        diameter,
                        -1,
                        -1,
                        AllplanReinf.BendingShapeType.Freeform
        )

And after that I added by hand hooks in property tab (03_Stirrup_with_hooks). How to automate this? Is there any way to add hooks to BendingShape during creation, or should I modify rebar after I create it? I tired AttributeService but I don't see any attribute responsible for hooks.

Allegati (3)

Type: image/png
22 scaricato
Size: 35,56 KiB
Type: image/png
17 scaricato
Size: 37,87 KiB
Type: image/png
15 scaricato
Size: 36,69 KiB

Show most helpful answer Hide most helpful answer

Hi!

What is the reason, why you don't use the ShapeBuilder? It would consider the concrete cover for you. Anyway, the second approach is the right one: hooks are not considered as regular legs. So if you want to create an open stirrup like on the images, the points could look, e.g. like this:

    points = [AllplanGeo.Point2D(0,600),
              AllplanGeo.Point2D(0,0),
              AllplanGeo.Point2D(300,0),
              AllplanGeo.Point2D(300,500),
              ]

And then you can create the bending shape like this:
    shape_props = ReinforcementShapeProperties.rebar(diameter           = 8,
                                                     bending_roller     = -1,
                                                     steel_grade        = -1,
                                                     concrete_grade     = -1,
                                                     bending_shape_type = AllplanReinf.BendingShapeType.OpenStirrup)

    shape_data = BarShapePointDataList([30,30])
    for point in points:
        shape_data.insert(-1, (point, 30))

    shape_builder = AllplanReinf.ReinforcementShapeBuilder()
    shape_builder.AddPoints(shape_data)
    shape_builder.SetHookStart(length = 0,
                               angle  = 135,
                               type   = AllplanReinf.HookType.eStirrup)

    shape_builder.SetHookEnd(length = 0,
                             angle  = 135,
                             type   = AllplanReinf.HookType.eStirrup)

    shape = shape_builder.CreateShape(shape_props)

Of course I have hard-coded some values, like concrete cover (30 mm). We actually described the usage of the ShapeBuilder quite extensively here.

Notice, that I am using the CreateShape method of the ShapeBuilder, not the CreateStirrup. As I tested the CreateStirrup I got a similar problem to your's: setting the hook angle to something larger than 90° is problematic. But with CreateShape it works.

Hope that helps!

Best,
Bart

Hi!

What is the reason, why you don't use the ShapeBuilder? It would consider the concrete cover for you. Anyway, the second approach is the right one: hooks are not considered as regular legs. So if you want to create an open stirrup like on the images, the points could look, e.g. like this:

    points = [AllplanGeo.Point2D(0,600),
              AllplanGeo.Point2D(0,0),
              AllplanGeo.Point2D(300,0),
              AllplanGeo.Point2D(300,500),
              ]

And then you can create the bending shape like this:
    shape_props = ReinforcementShapeProperties.rebar(diameter           = 8,
                                                     bending_roller     = -1,
                                                     steel_grade        = -1,
                                                     concrete_grade     = -1,
                                                     bending_shape_type = AllplanReinf.BendingShapeType.OpenStirrup)

    shape_data = BarShapePointDataList([30,30])
    for point in points:
        shape_data.insert(-1, (point, 30))

    shape_builder = AllplanReinf.ReinforcementShapeBuilder()
    shape_builder.AddPoints(shape_data)
    shape_builder.SetHookStart(length = 0,
                               angle  = 135,
                               type   = AllplanReinf.HookType.eStirrup)

    shape_builder.SetHookEnd(length = 0,
                             angle  = 135,
                             type   = AllplanReinf.HookType.eStirrup)

    shape = shape_builder.CreateShape(shape_props)

Of course I have hard-coded some values, like concrete cover (30 mm). We actually described the usage of the ShapeBuilder quite extensively here.

Notice, that I am using the CreateShape method of the ShapeBuilder, not the CreateStirrup. As I tested the CreateStirrup I got a similar problem to your's: setting the hook angle to something larger than 90° is problematic. But with CreateShape it works.

Hope that helps!

Best,
Bart

I try to avoid using ShapeBuilder due to lack of reliability. In long term I want to create general methods to reuse on more complex projects so creating shape directly gives me better control.

I wonder if is there a possibility to modify placement after it's sweeped, it would allow me to create shape manually and still be capable of adding hooks with methods relying on class like ShapeBuilder or similar.

Quotato da: PKrauze
I wonder if is there a possibility to modify placement after it's sweeped, it would allow me to create shape manually and still be capable of adding hooks with methods relying on class like ShapeBuilder or similar.

Accessing the BarPlacement object, once created in the drawing file, is currently not possible with the Python API. It is, however, pretty high on our roadmap.

Best,
Bart


https://campus.allplan.com/ utilizza cookies  -  Maggiori informazioni

Accetta