Thank you for the response,
I will try to explain a bit more: I`m creating the circular area reinforcement, making a section through it and them i would like to label each rebar that is in the section, when I`m doing this, Allplan says No placement found for position number 1. The position exists and I can create the label with the label function from Allplan (See the second picture - this is what I would like to create)
for creating the reinforcement:
def create_reinforcement(self):
"""
Create the circular reinforcement
Returns: created reinforcement
"""
rotation_axis = AllplanGeo.Line3D(AllplanGeo.Point3D(0, 0, 0),
AllplanGeo.Point3D(0, 0, self.h_1))
contour = AllplanGeo.Polyline3D()
contour += AllplanGeo.Point3D(self.r_1, 0, self.h_1)
contour += AllplanGeo.Point3D(self.r_2, 0, self.h_1)
circular_area = AllplanReinf.CircularAreaElement(1, 28,5, 5,
rotation_axis, contour,
0,
360,
0,
360,
-55, -55, -55)
circular_area.SetBarProperties(250, 11900, 1000,
1,
12000, 12000,
0, 10000)
circular_area.SetOverlap(1000, 0, True,
0, 1000, True,
1000)
return circular_area
and for labeling:
[...]
label_point = AllplanGeo.Point2D(3*self.r_1, 0)
pos_nr = AllplanReinforcement.ReinforcementUtil.GetNextBarPositionNumber(self.document)
label = AllplanReinforcement.ReinforcementLabel(
reinforcementType = AllplanReinforcement.Bar,
type = AllplanReinforcement.LabelType.LabelWithFan,
positionNumber = pos_nr,
labelProp = label_prop,
labelPoint = label_point,
angle = AllplanGeo.Angle())
labels = AllplanReinforcement.ReinforcementLabelList()
labels.append(label)
sect_ele = AllplanBasisElements.ViewSectionElement()
# placement point is bottom left point of the from the section path body in the view
view_props.PlacementPoint = right_view_place_pnt
view_props.PlacementAngle = math.radians(0)
sect_ele.GeneralSectionProperties = view_props
sect_ele.ViewMatrix = RotationAngles(-90, 0, 0).get_rotation_matrix()
sect_ele.TextElements = [view_label]
sect_ele.ReinforcementLabels = labels
I check the labeling script for bars that are placed with LinearBarBuilder.create_linear_bar_placement_from_to_by_dist and it worked.