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.