Reinforcement DrawingDimensioning: Difference between revisions

From FreeCAD Documentation
No edit summary
(Fix grammar issues)
Line 22: Line 22:


<!--T:3-->
<!--T:3-->
Please Note: The below work is present in develop branch of Reinforcement workbench [https://github.com/amrit3701/FreeCAD-Reinforcement/tree/develop here]
Please Note: The below work is present in the develop branch of the Reinforcement workbench [https://github.com/amrit3701/FreeCAD-Reinforcement/tree/develop here]


==Description== <!--T:4-->
==Description== <!--T:4-->
Line 45: Line 45:


<!--T:10-->
<!--T:10-->
2. In FreeCAD Python console, copy below code snippet to generate reinforcement drawing and dimensioning from different views for each [[Arch Structure|Arch Structure]] element.
2. In FreeCAD Python console, copy the below code snippet to generate reinforcement drawing and dimensioning from different views for each [[Arch Structure|Arch Structure]] element.
</translate>
</translate>
{{Code|code=
{{Code|code=
Line 100: Line 100:
drawing_min_right_offset=20,
drawing_min_right_offset=20,
drawing_min_bottom_offset=20,
drawing_min_bottom_offset=20,
drawing_max_width=0, # <translate>It is set to 0 to automatically set default width based on other parameters</translate>
drawing_max_width=0, # <translate>It is set to 0 to automatically set the default width based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set default height based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set the default height based on other parameters</translate>
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
perform_dimensioning=True,
perform_dimensioning=True,
Line 134: Line 134:


<!--T:15-->
<!--T:15-->
* It returns {{incode|structure_drawing_page_dict}}, a dictionary with structure as key and corresponding reinforcement drawing page as value.
* It returns {{incode|structure_drawing_page_dict}}, a dictionary with structure as key and corresponding reinforcement drawing page as the value.
* {{incode|structure_list}} is the list of structural objects to generate their reinforcement drawing. If not provided, structures will be selected from active document acting as Host for rebar objects.
* {{incode|structure_list}} is the list of structural objects to generate their reinforcement drawing. If not provided, structures will be selected from the active document acting as Host for rebar objects.
* {{incode|rebars_list}} is the list of rebar objects to be included in drawing. If not provided, rebars objects having Host in structure_list will be selected from active document.
* {{incode|rebars_list}} is the list of rebar objects to be included in the drawing. If not provided, rebars objects having Host in structure_list will be selected from the active document.
* {{incode|view}} specifies the view of drawing to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
* {{incode|view}} specifies the view of drawing to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
* {{incode|rebars_stroke_width}} specifies the stroke-width of rebars in drawing svg.
* {{incode|rebars_stroke_width}} specifies the stroke-width of rebars in drawing SVG.
* {{incode|rebars_color_style}} specifies the color style of rebars. Set it to "Automatic" to automatically select rebars color or "Custom" to choose shape color value from variable {{incode|rebars_color}}.
* {{incode|rebars_color_style}} specifies the color style of rebars. Set it to "Automatic" to automatically select rebars color or "Custom" to choose shape color value from variable {{incode|rebars_color}}.
* {{incode|rebars_color}} specifies the fill color for rebars in drawing svg.
* {{incode|rebars_color}} specifies the fill color for rebars in drawing SVG.
Format: (r, g, b)
Format: (r, g, b)
r, g, b value should be between 0 to 1, so you may need to divide value of r, g, b by 255 to get its value between 0 to 1
r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
Make sure r, g, b must be float
Make sure r, g, b must be float
Example: (0.67, 0.0, 0.0)
Example: (0.67, 0.0, 0.0)
* {{incode|structure_stroke_width}} specifies the stroke-width of structure in drawing svg.
* {{incode|structure_stroke_width}} specifies the stroke-width of structure in drawing SVG.
* {{incode|structure_color_style}} specifies the fill style of structure. Set it to "Automatic" to automatically select structure color or "Custom" to choose structure color value from variable {{incode|structure_color}}.
* {{incode|structure_color_style}} specifies the fill style of the structure. Set it to "Automatic" to automatically select structure color or "Custom" to choose structure color value from variable {{incode|structure_color}}.
* {{incode|structure_color}} specifies the fill color for structure in drawing svg. Format: (r, g, b)
* {{incode|structure_color}} specifies the fill color for structure in drawing SVG. Format: (r, g, b)
* {{incode|drawing_left_offset}} specifies the left offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_left_offset}} specifies the left offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_top_offset}} specifies the top offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_top_offset}} specifies the top offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_min_right_offset}} specifies the minimum right offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_min_right_offset}} specifies the minimum right offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_min_bottom_offset}} specifies the minimum bottom offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_min_bottom_offset}} specifies the minimum bottom offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_max_width}} specifies the maximum width of drawing on {{incode|template_file}}.
* {{incode|drawing_max_width}} specifies the maximum width of drawing on {{incode|template_file}}.
* {{incode|drawing_max_height}} specifies the maximum height of drawing on {{incode|template_file}}.
* {{incode|drawing_max_height}} specifies the maximum height of drawing on {{incode|template_file}}.
* {{incode|template_file}} is the template file to be used for reinforcement drawing page.
* {{incode|template_file}} is the template file to be used for the reinforcement drawing page.


<!--T:16-->
<!--T:16-->
* {{incode|perform_dimensioning}} specifies if dimensioning needs to be created for rebars in drawing.
* {{incode|perform_dimensioning}} specifies if dimensioning needs to be created for rebars in drawing.
* {{incode|dimension_rebars_filter_list}} is the list of rebars to perform dimensioning. Set it to None to dimension all visible rebars in drawing.
* {{incode|dimension_rebars_filter_list}} is the list of rebars to perform dimensioning. Set it to None to dimension all visible rebars in drawing.
* {{incode|dimension_label_format}} is the format used for dimension label.
* {{incode|dimension_label_format}} is the format used for the dimension label.
Example: "%M %C⌀%D,span=%S"
Example: "%M %C⌀%D,span=%S"
Here: %M -> Rebar.Mark
Here: %M -> Rebar.Mark
Line 166: Line 166:
%S -> Rebar span length
%S -> Rebar span length
* {{incode|dimension_font_family}} is the font family of dimension label.
* {{incode|dimension_font_family}} is the font family of dimension label.
* {{incode|dimension_font_size}} is the font size of dimension label.
* {{incode|dimension_font_size}} is the font size of the dimension label.
* {{incode|dimension_stroke_width}} is the stroke-width of dimension line.
* {{incode|dimension_stroke_width}} is the stroke-width of dimension line.
* {{incode|dimension_line_style}} is the stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
* {{incode|dimension_line_style}} is the stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
* {{incode|dimension_line_color}} is the color of dimension line.
* {{incode|dimension_line_color}} is the color of the dimension line.
Format: (r, g, b)
Format: (r, g, b)
r, g, b value should be between 0 to 1, so you may need to divide value of r, g, b by 255 to get its value between 0 to 1
r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
Make sure r, g, b must be float
Make sure r, g, b must be float
* {{incode|dimension_text_color}} is the color of dimension label.
* {{incode|dimension_text_color}} is the color of the dimension label.
* {{incode|dimension_single_rebar_line_start_symbol}} is the dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_single_rebar_line_start_symbol}} is the dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_single_rebar_line_end_symbol}} is the dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_single_rebar_line_end_symbol}} is the dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_start_symbol}} is the dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_start_symbol}} is the dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_end_symbol}} is the dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_end_symbol}} is the dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_line_mid_point_symbol}} is the dimension line mid points symbol. It can be "Tick", "Dot" or "None".
* {{incode|dimension_line_mid_point_symbol}} is the dimension line midpoints symbol. It can be "Tick", "Dot" or "None".
* {{incode|dimension_left_offset}} specifies the left offset of dimension from drawing.
* {{incode|dimension_left_offset}} specifies the left offset of the dimension from drawing.
* {{incode|dimension_right_offset}} specifies the right offset of dimension from drawing.
* {{incode|dimension_right_offset}} specifies the right offset of the dimension from drawing.
* {{incode|dimension_top_offset}} specifies the top offset of dimension from drawing.
* {{incode|dimension_top_offset}} specifies the top offset of the dimension from drawing.
* {{incode|dimension_bottom_offset}} specifies the bottom offset of dimension from drawing.
* {{incode|dimension_bottom_offset}} specifies the bottom offset of the dimension from drawing.
* {{incode|dimension_left_offset_increment}} is the increment in left offset to move each new dimension label away from drawing.
* {{incode|dimension_left_offset_increment}} is the increment in the left offset to move each new dimension label away from drawing.
* {{incode|dimension_right_offset_increment}} is the increment in right offset to move each new dimension label away from drawing.
* {{incode|dimension_right_offset_increment}} is the increment in the right offset to move each new dimension label away from drawing.
* {{incode|dimension_top_offset_increment}} is the increment in top offset to move each new dimension label away from drawing.
* {{incode|dimension_top_offset_increment}} is the increment in the top offset to move each new dimension label away from drawing.
* {{incode|dimension_bottom_offset_increment}} is the increment in bottom offset to move each new dimension label away from drawing.
* {{incode|dimension_bottom_offset_increment}} is the increment in the bottom offset to move each new dimension label away from drawing.
* {{incode|dimension_single_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible.
* {{incode|dimension_single_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible.
* {{incode|dimension_multi_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible.
* {{incode|dimension_multi_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible.
Line 289: Line 289:
drawing_min_right_offset=20,
drawing_min_right_offset=20,
drawing_min_bottom_offset=20,
drawing_min_bottom_offset=20,
drawing_max_width=0, # <translate>It is set to 0 to automatically set default width based on other parameters</translate>
drawing_max_width=0, # <translate>It is set to 0 to automatically set the default width based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set default height based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set the default height based on other parameters</translate>
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
perform_dimensioning=True,
perform_dimensioning=True,
Line 346: Line 346:


<!--T:24-->
<!--T:24-->
2. In FreeCAD Python console, copy below code snippet to generate reinforcement drawing from different views for each [[Arch Structure|Arch Structure]] element.
2. In FreeCAD Python console, copy the below code snippet to generate reinforcement drawing from different views for each [[Arch Structure|Arch Structure]] element.
</translate>
</translate>
{{Code|code=
{{Code|code=
Line 366: Line 366:


<!--T:28-->
<!--T:28-->
* {{PropertyData|Structure}}: The structure object acting as Host for rebars to be included in drawing.
* {{PropertyData|Structure}}: The structure object acting as a Host for rebars to be included in the drawing.
* {{PropertyData|Rebars}}: The list of rebar objects to be included in drawing.
* {{PropertyData|Rebars}}: The list of rebar objects to be included in the drawing.
* {{PropertyData|View}}: The reinforcement drawing view to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
* {{PropertyData|View}}: The reinforcement drawing view to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
* {{PropertyData|PositionType}}: The position type of Reinforcement Drawing on Template. It can be "Automatic" to calculate drawing placement using {{PropertyData|LeftOffset}}, {{PropertyData|TopOffset}}, {{PropertyData|MinRightOffset}} and {{PropertyData|MinBottomOffset}} OR "Custom" to set placement using {{PropertyData|X}} and {{PropertyData|Y}}.
* {{PropertyData|PositionType}}: The position type of Reinforcement Drawing on Template. It can be "Automatic" to calculate drawing placement using {{PropertyData|LeftOffset}}, {{PropertyData|TopOffset}}, {{PropertyData|MinRightOffset}} and {{PropertyData|MinBottomOffset}} OR "Custom" to set placement using {{PropertyData|X}} and {{PropertyData|Y}}.
* {{PropertyData|RebarsStrokeWidth}}: The stroke width of rebars in Reinforcement Drawing svg.
* {{PropertyData|RebarsStrokeWidth}}: The stroke width of rebars in Reinforcement Drawing SVG.
* {{PropertyData|RebarsColorStyle}}: The color style of rebars in Reinforcement Drawing svg. Set it to "Automatic" to automatically select rebars color OR "Custom" to choose shape color value from {{PropertyData|RebarsColor}}.
* {{PropertyData|RebarsColorStyle}}: The color style of rebars in Reinforcement Drawing SVG. Set it to "Automatic" to automatically select rebars color OR "Custom" to choose shape color value from {{PropertyData|RebarsColor}}.
* {{PropertyData|RebarsColor}}: The color of rebars in Reinforcement Drawing svg.
* {{PropertyData|RebarsColor}}: The color of rebars in Reinforcement Drawing SVG.
* {{PropertyData|StructureStrokeWidth}}: The stroke width of structure in Reinforcement Drawing svg.
* {{PropertyData|StructureStrokeWidth}}: The stroke width of the structure in Reinforcement Drawing SVG.
* {{PropertyData|StructureColorStyle}}: The color style of structure in Reinforcement Drawing svg. Set it to "Automatic" to automatically select rebars color, "Custom" to choose shape color value from {{PropertyData|StructureColor}} OR "None" to not fill structure.
* {{PropertyData|StructureColorStyle}}: The color style of structure in Reinforcement Drawing SVG. Set it to "Automatic" to automatically select rebars color, "Custom" to choose shape color value from {{PropertyData|StructureColor}} OR "None" to not fill structure.
* {{PropertyData|StructureColor}}: The color of structure in Reinforcement Drawing svg.
* {{PropertyData|StructureColor}}: The color of structure in Reinforcement Drawing SVG.
* {{PropertyData|Template}}: The template for Reinforcement Drawing view.
* {{PropertyData|Template}}: The template for the Reinforcement Drawing view.
* {{PropertyData|Width}}: The width of Reinforcement Drawing view svg.
* {{PropertyData|Width}}: The width of the Reinforcement Drawing view SVG.
* {{PropertyData|Height}}: The height of Reinforcement Drawing view svg.
* {{PropertyData|Height}}: The height of Reinforcement Drawing view SVG.
* {{PropertyData|LeftOffset}}: The left offset of Reinforcement Drawing view on template.
* {{PropertyData|LeftOffset}}: The left offset of Reinforcement Drawing view on a template.
* {{PropertyData|TopOffset}}: The top offset of Reinforcement Drawing view on template.
* {{PropertyData|TopOffset}}: The top offset of Reinforcement Drawing view on a template.
* {{PropertyData|MinRightOffset}}: The minimum right offset of Reinforcement Drawing view on template.
* {{PropertyData|MinRightOffset}}: The minimum right offset of Reinforcement Drawing view on a template.
* {{PropertyData|MinBottomOffset}}: The minimum bottom offset of Reinforcement Drawing view on template.
* {{PropertyData|MinBottomOffset}}: The minimum bottom offset of Reinforcement Drawing view on a template.
* {{PropertyData|MaxWidth}}: The maximum width of Reinforcement Drawing view.
* {{PropertyData|MaxWidth}}: The maximum width of the Reinforcement Drawing view.
* {{PropertyData|MaxHeight}}: The maximum height of Reinforcement Drawing view.
* {{PropertyData|MaxHeight}}: The maximum height of the Reinforcement Drawing view.
* {{PropertyData|VisibleRebars}}: The list of visible rebar objects in drawing view.
* {{PropertyData|VisibleRebars}}: The list of visible rebar objects in the drawing view.
* {{PropertyData|DimensionLeftOffset}}: The left offset for each new ReinforcementDimensioning object.
* {{PropertyData|DimensionLeftOffset}}: The left offset for each new ReinforcementDimensioning object.
* {{PropertyData|DimensionRightOffset}}: The right offset for each new ReinforcementDimensioning object.
* {{PropertyData|DimensionRightOffset}}: The right offset for each new ReinforcementDimensioning object.
Line 435: Line 435:


<!--T:34-->
<!--T:34-->
* Creates a {{incode|ReinforcementDrawingView}} object for given [[Arch Structure|structure]] and [[Arch Rebar|rebar]] objects list.
* Creates a {{incode|ReinforcementDrawingView}} object for the given [[Arch Structure|structure]] and [[Arch Rebar|rebar]] objects list.
* It returns the {{incode|reinforcement_drawing_page}} of type {{incode|TechDraw::DrawPage}}.
* It returns the {{incode|reinforcement_drawing_page}} of type {{incode|TechDraw::DrawPage}}.
* {{incode|view}} specifies the view of drawing to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
* {{incode|view}} specifies the view of drawing to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
* {{incode|rebars_stroke_width}} specifies the stroke-width of rebars in drawing svg.
* {{incode|rebars_stroke_width}} specifies the stroke-width of rebars in drawing SVG.
* {{incode|rebars_color_style}} specifies the color style of rebars. Set it to "Automatic" to automatically select rebars color or "Custom" to choose shape color value from variable {{incode|rebars_color}}.
* {{incode|rebars_color_style}} specifies the color style of rebars. Set it to "Automatic" to automatically select rebars color or "Custom" to choose shape color value from variable {{incode|rebars_color}}.
* {{incode|rebars_color}} specifies the fill color for rebars in drawing svg.
* {{incode|rebars_color}} specifies the fill color for rebars in drawing SVG.
Format: (r, g, b)
Format: (r, g, b)
r, g, b value should be between 0 to 1, so you may need to divide value of r, g, b by 255 to get its value between 0 to 1
r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
Make sure r, g, b must be float
Make sure r, g, b must be float
Example: (0.67, 0.0, 0.0)
Example: (0.67, 0.0, 0.0)
* {{incode|structure_stroke_width}} specifies the stroke-width of structure in drawing svg.
* {{incode|structure_stroke_width}} specifies the stroke-width of structure in drawing SVG.
* {{incode|structure_color_style}} specifies the fill style of structure. Set it to "Automatic" to automatically select structure color or "Custom" to choose structure color value from variable {{incode|structure_color}}.
* {{incode|structure_color_style}} specifies the fill style of the structure. Set it to "Automatic" to automatically select structure color or "Custom" to choose structure color value from variable {{incode|structure_color}}.
* {{incode|structure_color}} specifies the fill color for structure in drawing svg. Format: (r, g, b)
* {{incode|structure_color}} specifies the fill color for structure in drawing SVG. Format: (r, g, b)
* {{incode|drawing_left_offset}} specifies the left offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_left_offset}} specifies the left offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_top_offset}} specifies the top offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_top_offset}} specifies the top offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_min_right_offset}} specifies the minimum right offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_min_right_offset}} specifies the minimum right offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_min_bottom_offset}} specifies the minimum bottom offset of drawing view on {{incode|template_file}}.
* {{incode|drawing_min_bottom_offset}} specifies the minimum bottom offset of the drawing view on {{incode|template_file}}.
* {{incode|drawing_max_width}} specifies the maximum width of drawing on {{incode|template_file}}.
* {{incode|drawing_max_width}} specifies the maximum width of drawing on {{incode|template_file}}.
* {{incode|drawing_max_height}} specifies the maximum height of drawing on {{incode|template_file}}.
* {{incode|drawing_max_height}} specifies the maximum height of drawing on {{incode|template_file}}.
* {{incode|template_file}} is the template file to be used for reinforcement drawing page.
* {{incode|template_file}} is the template file to be used for the reinforcement drawing page.
* {{incode|dimension_left_offset}} specifies the left offset of dimension from drawing.
* {{incode|dimension_left_offset}} specifies the left offset of the dimension from drawing.
* {{incode|dimension_right_offset}} specifies the right offset of dimension from drawing.
* {{incode|dimension_right_offset}} specifies the right offset of the dimension from drawing.
* {{incode|dimension_top_offset}} specifies the top offset of dimension from drawing.
* {{incode|dimension_top_offset}} specifies the top offset of the dimension from drawing.
* {{incode|dimension_bottom_offset}} specifies the bottom offset of dimension from drawing.
* {{incode|dimension_bottom_offset}} specifies the bottom offset of the dimension from drawing.


</translate>
</translate>
Line 527: Line 527:
drawing_min_right_offset=20,
drawing_min_right_offset=20,
drawing_min_bottom_offset=20,
drawing_min_bottom_offset=20,
drawing_max_width=0, # <translate>It is set to 0 to automatically set default width based on other parameters</translate>
drawing_max_width=0, # <translate>It is set to 0 to automatically set the default width based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set default height based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set the default height based on other parameters</translate>
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
dimension_left_offset=10,
dimension_left_offset=10,
Line 570: Line 570:


<!--T:39-->
<!--T:39-->
* It returns {{incode|structure_drawing_page_dict}}, a dictionary with structure as key and corresponding reinforcement drawing page as value.
* It returns {{incode|structure_drawing_page_dict}}, a dictionary with structure as key and corresponding reinforcement drawing page as the value.
* {{incode|structure_list}} is the list of structural objects to generate their reinforcement drawing. If not provided, structures will be selected from active document acting as Host for rebar objects.
* {{incode|structure_list}} is the list of structural objects to generate their reinforcement drawing. If not provided, structures will be selected from the active document acting as Host for rebar objects.
* {{incode|rebars_list}} is the list of rebar objects to be included in drawing. If not provided, rebars objects having Host in structure_list will be selected from active document.
* {{incode|rebars_list}} is the list of rebar objects to be included in the drawing. If not provided, rebars objects having Host in structure_list will be selected from the active document.


</translate>
</translate>
Line 670: Line 670:
drawing_min_right_offset=20,
drawing_min_right_offset=20,
drawing_min_bottom_offset=20,
drawing_min_bottom_offset=20,
drawing_max_width=0, # <translate>It is set to 0 to automatically set default width based on other parameters</translate>
drawing_max_width=0, # <translate>It is set to 0 to automatically set the default width based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set default height based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set the default height based on other parameters</translate>
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
dimension_left_offset=10,
dimension_left_offset=10,
Line 692: Line 692:


<!--T:47-->
<!--T:47-->
2. In FreeCAD Python console, copy below code snippet to generate reinforcement drawing and dimensioning from different views for each [[Arch Structure|Arch Structure]] element.
2. In FreeCAD Python console, copy the below code snippet to generate reinforcement drawing and dimensioning from different views for each [[Arch Structure|Arch Structure]] element.
</translate>
</translate>
{{Code|code=
{{Code|code=
Line 727: Line 727:


<!--T:51-->
<!--T:51-->
* {{PropertyData|ParentDrawingView}}: The parent ReinforcementDrawingView object containing drawing of [[Arch Rebar|Rebar]] object.
* {{PropertyData|ParentDrawingView}}: The parent ReinforcementDrawingView object containing the drawing of [[Arch Rebar|Rebar]] object.
* {{PropertyData|Rebar}}: The [[Arch Rebar|Rebar]] object to perform dimensioning.
* {{PropertyData|Rebar}}: The [[Arch Rebar|Rebar]] object to perform dimensioning.
* {{PropertyData|WayPointsType}}: The WayPoints type of dimension line. It can be "Automatic" (to automatically perform dimensioning of [[Arch Rebar|Rebar]] object) or "Custom" to use {{PropertyData|WayPoints}} to perform dimensioning.
* {{PropertyData|WayPointsType}}: The WayPoints type of dimension line. It can be "Automatic" (to automatically perform dimensioning of [[Arch Rebar|Rebar]] object) or "Custom" to use {{PropertyData|WayPoints}} to perform dimensioning.
* {{PropertyData|WayPoints}}: A list of vector points to be used to generate dimension line.
* {{PropertyData|WayPoints}}: A list of vector points to be used to generate a dimension line.
* {{PropertyData|TextPositionType}}: The position type of dimension text. It can be "StartOfLine", "MidOfLine" or "EndOfLine".
* {{PropertyData|TextPositionType}}: The position type of dimension text. It can be "StartOfLine", "MidOfLine" or "EndOfLine".
* {{PropertyData|DimensionFormat}}: The dimension label format.
* {{PropertyData|DimensionFormat}}: The dimension label format.
Line 739: Line 739:
%S -> Rebar span length
%S -> Rebar span length
* {{PropertyData|Font}}: The font family of dimension label.
* {{PropertyData|Font}}: The font family of dimension label.
* {{PropertyData|FontSize}}: The font size of dimension label.
* {{PropertyData|FontSize}}: The font size of the dimension label.
* {{PropertyData|StrokeWidth}}: The stroke width of dimension line.
* {{PropertyData|StrokeWidth}}: The stroke width of the dimension line.
* {{PropertyData|LineStyle}}: The stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
* {{PropertyData|LineStyle}}: The stroke style of the dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
* {{PropertyData|LineColor}}: The color of dimension line.
* {{PropertyData|LineColor}}: The color of the dimension line.
* {{PropertyData|TextColor}}: The color of dimension label.
* {{PropertyData|TextColor}}: The color of the dimension label.
* {{PropertyData|LineStartSymbol}}: The start symbol of dimension line. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{PropertyData|LineStartSymbol}}: The start symbol of the dimension line. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{PropertyData|LineEndSymbol}}: The end symbol of dimension line. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{PropertyData|LineEndSymbol}}: The end symbol of the dimension line. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{PropertyData|LineMidPointSymbol}}: The mid points symbol of dimension line. It can be "Tick", "Dot" or "None".
* {{PropertyData|LineMidPointSymbol}}: The midpoints symbol of the dimension line. It can be "Tick", "Dot" or "None".
* {{PropertyData|DimensionLeftOffset}}: The left offset for automated reinforcement dimensioning.
* {{PropertyData|DimensionLeftOffset}}: The left offset for automated reinforcement dimensioning.
* {{PropertyData|DimensionRightOffset}}: The right offset for automated reinforcement dimensioning.
* {{PropertyData|DimensionRightOffset}}: The right offset for automated reinforcement dimensioning.
Line 805: Line 805:


<!--T:56-->
<!--T:56-->
* Creates and return a {{incode|ReinforcementDimensioning}} object for given {{incode|rebar}} object.
* Creates and returns a {{incode|ReinforcementDimensioning}} object for the given {{incode|rebar}} object.
* {{incode|parent_drawing_view}} is the {{incode|ReinforcementDrawingView}} object containing drawing of {{incode|rebar}} object.
* {{incode|parent_drawing_view}} is the {{incode|ReinforcementDrawingView}} object containing a drawing of {{incode|rebar}} object.
* {{incode|drawing_page}} is the object of type TechDraw::DrawPage used to show {{incode|parent_drawing_view}}.
* {{incode|drawing_page}} is the object of type TechDraw::DrawPage used to show {{incode|parent_drawing_view}}.
* {{incode|dimension_label_format}} is the format used for dimension label.
* {{incode|dimension_label_format}} is the format used for the dimension label.
Example: "%M %C⌀%D,span=%S"
Example: "%M %C⌀%D,span=%S"
Here: %M -> Rebar.Mark
Here: %M -> Rebar.Mark
Line 815: Line 815:
%S -> Rebar span length
%S -> Rebar span length
* {{incode|dimension_font_family}} is the font family of dimension label.
* {{incode|dimension_font_family}} is the font family of dimension label.
* {{incode|dimension_font_size}} is the font size of dimension label.
* {{incode|dimension_font_size}} is the font size of the dimension label.
* {{incode|dimension_stroke_width}} is the stroke-width of dimension line.
* {{incode|dimension_stroke_width}} is the stroke-width of dimension line.
* {{incode|dimension_line_style}} is the stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
* {{incode|dimension_line_style}} is the stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
* {{incode|dimension_line_color}} is the color of dimension line.
* {{incode|dimension_line_color}} is the color of the dimension line.
Format: (r, g, b)
Format: (r, g, b)
r, g, b value should be between 0 to 1, so you may need to divide value of r, g, b by 255 to get its value between 0 to 1
r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
Make sure r, g, b must be float
Make sure r, g, b must be float
* {{incode|dimension_text_color}} is the color of dimension label.
* {{incode|dimension_text_color}} is the color of the dimension label.
* {{incode|dimension_single_rebar_line_start_symbol}} is the dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_single_rebar_line_start_symbol}} is the dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_single_rebar_line_end_symbol}} is the dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_single_rebar_line_end_symbol}} is the dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_start_symbol}} is the dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_start_symbol}} is the dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_end_symbol}} is the dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_multi_rebar_line_end_symbol}} is the dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
* {{incode|dimension_line_mid_point_symbol}} is the dimension line mid points symbol. It can be "Tick", "Dot" or "None".
* {{incode|dimension_line_mid_point_symbol}} is the dimension line midpoints symbol. It can be "Tick", "Dot" or "None".
* {{incode|dimension_left_offset_increment}} is the increment in left offset to move each new dimension label away from drawing.
* {{incode|dimension_left_offset_increment}} is the increment in the left offset to move each new dimension label away from drawing.
* {{incode|dimension_right_offset_increment}} is the increment in right offset to move each new dimension label away from drawing.
* {{incode|dimension_right_offset_increment}} is the increment in the right offset to move each new dimension label away from drawing.
* {{incode|dimension_top_offset_increment}} is the increment in top offset to move each new dimension label away from drawing.
* {{incode|dimension_top_offset_increment}} is the increment in the top offset to move each new dimension label away from drawing.
* {{incode|dimension_bottom_offset_increment}} is the increment in bottom offset to move each new dimension label away from drawing.
* {{incode|dimension_bottom_offset_increment}} is the increment in the bottom offset to move each new dimension label away from drawing.
* {{incode|dimension_single_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible.
* {{incode|dimension_single_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible.
* {{incode|dimension_multi_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible.
* {{incode|dimension_multi_rebar_outer_dim}} specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible.
Line 906: Line 906:
drawing_min_right_offset=20,
drawing_min_right_offset=20,
drawing_min_bottom_offset=20,
drawing_min_bottom_offset=20,
drawing_max_width=0, # <translate>It is set to 0 to automatically set default width based on other parameters</translate>
drawing_max_width=0, # <translate>It is set to 0 to automatically set the default width based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set default height based on other parameters</translate>
drawing_max_height=0, # <translate>It is set to 0 to automatically set the default height based on other parameters</translate>
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
dimension_left_offset=10,
dimension_left_offset=10,

Revision as of 16:32, 6 September 2020

Arch Rebar Drawing Dimensioning

Menu location
None
Workbenches
Reinforcement, Arch, BIM
Default shortcut
None
Introduced in version
0.19
See also
Bill Of Material, Rebar Shape Cut List

Please Note: The below work is present in the develop branch of the Reinforcement workbench here

Description

The Reinforcement Drawing Dimensioning tool allows the user to create drawing and dimensioning of reinforcing bars.

This command is part of the Reinforcement Workbench, an external workbench that can be installed with the Addon Manager via the Tools → Addon manager → Reinforcement menu.

Drawing and dimensioning of reinforcing bars

Usage

1. Open FreeCAD Model containing reinforcement bars created using Reinforcement Addon.

2. In FreeCAD Python console, copy the below code snippet to generate reinforcement drawing and dimensioning from different views for each Arch Structure element.

from ReinforcementDrawing.make_reinforcement_drawing import (
    makeStructuresReinforcementDrawing,
)

for view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    struct_drawing_page_dict = makeStructuresReinforcementDrawing(
        view=view, perform_dimensioning=True
    )
    for drawing_page in struct_drawing_page_dict.values():
        drawing_view = drawing_page.Views[0]
        drawing_view.setExpression(
            "LeftOffset",
            u".Template.Width.Value / 2 - .Width.Value * .Scale / 2",
        )
        drawing_view.setExpression(
            "TopOffset",
            u".Template.Height.Value / 2 - .Height.Value * .Scale / 2",
        )
        drawing_view.recompute(True)
        drawing_page.recompute(True)

Scripting

See also: Arch API, Reinforcement API and FreeCAD Scripting Basics.

The Reinforcement Drawing Dimensioning tool can be used in macros and from the Python console by using the following function:

Create Reinforcement Drawing And Dimensioning

from ReinforcementDrawing import make_reinforcement_drawing

structure_drawing_page_dict = make_reinforcement_drawing.makeStructuresReinforcementDrawing(
    structure_list=None,
    rebars_list=None,
    view="Front",
    rebars_stroke_width=0.35,
    rebars_color_style="Automatic",
    rebars_color=(0.67, 0.0, 0.0),
    structure_stroke_width=0.5,
    structure_color_style="Automatic",
    structure_color=(0.3, 0.9, 0.91),
    drawing_left_offset=20,
    drawing_top_offset=20,
    drawing_min_right_offset=20,
    drawing_min_bottom_offset=20,
    drawing_max_width=0,                        # It is set to 0 to automatically set the default width based on other parameters
    drawing_max_height=0,                       # It is set to 0 to automatically set the default height based on other parameters
    template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
    perform_dimensioning=True,
    dimension_rebars_filter_list=None,
    dimension_label_format="%M %C⌀%D,span=%S",
    dimension_font_family="DejaVu Sans",
    dimension_font_size=3,
    dimension_stroke_width=0.25,
    dimension_line_style="Continuous",
    dimension_line_color=(0.0, 0.0, 0.50),
    dimension_text_color=(0.0, 0.33, 0.0),
    dimension_single_rebar_line_start_symbol="None",
    dimension_single_rebar_line_end_symbol="FilledArrow",
    dimension_multi_rebar_line_start_symbol="FilledArrow",
    dimension_multi_rebar_line_end_symbol="FilledArrow",
    dimension_line_mid_point_symbol="Dot",
    dimension_left_offset=10,
    dimension_right_offset=10,
    dimension_top_offset=10,
    dimension_bottom_offset=10,
    dimension_left_offset_increment=6,
    dimension_right_offset_increment=6,
    dimension_top_offset_increment=6,
    dimension_bottom_offset_increment=6,
    dimension_single_rebar_outer_dim=False,
    dimension_multi_rebar_outer_dim=True,
    dimension_single_rebar_text_position_type="StartOfLine",
    dimension_multi_rebar_text_position_type="MidOfLine",
)
  • It returns structure_drawing_page_dict, a dictionary with structure as key and corresponding reinforcement drawing page as the value.
  • structure_list is the list of structural objects to generate their reinforcement drawing. If not provided, structures will be selected from the active document acting as Host for rebar objects.
  • rebars_list is the list of rebar objects to be included in the drawing. If not provided, rebars objects having Host in structure_list will be selected from the active document.
  • view specifies the view of drawing to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
  • rebars_stroke_width specifies the stroke-width of rebars in drawing SVG.
  • rebars_color_style specifies the color style of rebars. Set it to "Automatic" to automatically select rebars color or "Custom" to choose shape color value from variable rebars_color.
  • rebars_color specifies the fill color for rebars in drawing SVG.
   Format: (r, g, b)
   r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
   Make sure r, g, b must be float
   Example: (0.67, 0.0, 0.0)
  • structure_stroke_width specifies the stroke-width of structure in drawing SVG.
  • structure_color_style specifies the fill style of the structure. Set it to "Automatic" to automatically select structure color or "Custom" to choose structure color value from variable structure_color.
  • structure_color specifies the fill color for structure in drawing SVG. Format: (r, g, b)
  • drawing_left_offset specifies the left offset of the drawing view on template_file.
  • drawing_top_offset specifies the top offset of the drawing view on template_file.
  • drawing_min_right_offset specifies the minimum right offset of the drawing view on template_file.
  • drawing_min_bottom_offset specifies the minimum bottom offset of the drawing view on template_file.
  • drawing_max_width specifies the maximum width of drawing on template_file.
  • drawing_max_height specifies the maximum height of drawing on template_file.
  • template_file is the template file to be used for the reinforcement drawing page.
  • perform_dimensioning specifies if dimensioning needs to be created for rebars in drawing.
  • dimension_rebars_filter_list is the list of rebars to perform dimensioning. Set it to None to dimension all visible rebars in drawing.
  • dimension_label_format is the format used for the dimension label.
   Example: "%M %C⌀%D,span=%S"
   Here: %M -> Rebar.Mark
         %C -> Rebar.Amount
         %D -> Rebar.Diameter
         %S -> Rebar span length
  • dimension_font_family is the font family of dimension label.
  • dimension_font_size is the font size of the dimension label.
  • dimension_stroke_width is the stroke-width of dimension line.
  • dimension_line_style is the stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
  • dimension_line_color is the color of the dimension line.
   Format: (r, g, b)
   r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
   Make sure r, g, b must be float
  • dimension_text_color is the color of the dimension label.
  • dimension_single_rebar_line_start_symbol is the dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_single_rebar_line_end_symbol is the dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_multi_rebar_line_start_symbol is the dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_multi_rebar_line_end_symbol is the dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_line_mid_point_symbol is the dimension line midpoints symbol. It can be "Tick", "Dot" or "None".
  • dimension_left_offset specifies the left offset of the dimension from drawing.
  • dimension_right_offset specifies the right offset of the dimension from drawing.
  • dimension_top_offset specifies the top offset of the dimension from drawing.
  • dimension_bottom_offset specifies the bottom offset of the dimension from drawing.
  • dimension_left_offset_increment is the increment in the left offset to move each new dimension label away from drawing.
  • dimension_right_offset_increment is the increment in the right offset to move each new dimension label away from drawing.
  • dimension_top_offset_increment is the increment in the top offset to move each new dimension label away from drawing.
  • dimension_bottom_offset_increment is the increment in the bottom offset to move each new dimension label away from drawing.
  • dimension_single_rebar_outer_dim specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible.
  • dimension_multi_rebar_outer_dim specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible.
  • dimension_single_rebar_text_position_type specifies the dimension label position type, in case of single rebar is visible. It can be "StartOfLine", "MidOfLine" or "EndOfLine".
  • dimension_multi_rebar_text_position_type specifies the dimension label position type, in case of multiple rebars are visible. It can be "StartOfLine", "MidOfLine" or "EndOfLine".


Example
from pathlib import Path
import FreeCAD, Draft, Arch
from ColumnReinforcement import TwoTiesSixRebars
from ReinforcementDrawing import make_reinforcement_drawing

Rect = Draft.makeRectangle(400, 400)
Structure1 = Arch.makeStructure(Rect, height=1600)
Structure1.ViewObject.Transparency = 80
Structure2 = Arch.makeStructure(Rect, height=1600)
Structure2.ViewObject.Transparency = 80
Structure2.Placement = FreeCAD.Placement(FreeCAD.Vector(1000, 0, 0), FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1), 0))
FreeCAD.ActiveDocument.recompute()

# Create Straight Rebars
TwoTiesSixRebars.makeTwoTiesSixRebars(
    l_cover_of_ties=40,        
    r_cover_of_ties=40,
    t_cover_of_ties=40,
    b_cover_of_ties=40,
    offset_of_ties=100,
    bent_angle_of_ties=135,
    extension_factor_of_ties=2,
    dia_of_ties=8,
    number_spacing_check=True,
    number_spacing_value=10,
    dia_of_main_rebars=16,
    t_offset_of_rebars=40,
    b_offset_of_rebars=40,
    main_rebars_type="StraightRebar",
    hook_orientation="Top Inside",
    hook_extend_along="x-axis",
    l_rebar_rounding=None,
    hook_extension=None,
    ties_sequence=("Tie1", "Tie2"),
    structure=Structure1,
    facename="Face6",
)

# Create LShaped Rebars with hook along x-axis
TwoTiesSixRebars.makeTwoTiesSixRebars(
    l_cover_of_ties=40,
    r_cover_of_ties=40,
    t_cover_of_ties=40,
    b_cover_of_ties=40,
    offset_of_ties=100,
    bent_angle_of_ties=135,
    extension_factor_of_ties=2,
    dia_of_ties=8,
    number_spacing_check=True,
    number_spacing_value=10,
    dia_of_main_rebars=16,
    t_offset_of_rebars=-40,
    b_offset_of_rebars=-40,
    main_rebars_type="LShapeRebar",
    hook_orientation="Top Outside",
    hook_extend_along="x-axis",
    l_rebar_rounding=2,
    hook_extension=40,
    ties_sequence=("Tie1", "Tie2"),
    structure=Structure2,
    facename="Face6",
)

# Create Reinforcement Drawing and Dimensioning
for drawing_view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    struct_drawing_page_dict = make_reinforcement_drawing.makeStructuresReinforcementDrawing(
        structure_list=None,
        rebars_list=None,
        view="Front",
        rebars_stroke_width=0.35,
        rebars_color_style="Automatic",
        rebars_color=(0.67, 0.0, 0.0),
        structure_stroke_width=0.5,
        structure_color_style="Automatic",
        structure_color=(0.3, 0.9, 0.91),
        drawing_left_offset=20,
        drawing_top_offset=20,
        drawing_min_right_offset=20,
        drawing_min_bottom_offset=20,
        drawing_max_width=0,                        # It is set to 0 to automatically set the default width based on other parameters
        drawing_max_height=0,                       # It is set to 0 to automatically set the default height based on other parameters
        template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
        perform_dimensioning=True,
        dimension_rebars_filter_list=None,
        dimension_label_format="%M %C⌀%D,span=%S",
        dimension_font_family="DejaVu Sans",
        dimension_font_size=3,
        dimension_stroke_width=0.25,
        dimension_line_style="Continuous",
        dimension_line_color=(0.0, 0.0, 0.50),
        dimension_text_color=(0.0, 0.33, 0.0),
        dimension_single_rebar_line_start_symbol="None",
        dimension_single_rebar_line_end_symbol="FilledArrow",
        dimension_multi_rebar_line_start_symbol="FilledArrow",
        dimension_multi_rebar_line_end_symbol="FilledArrow",
        dimension_line_mid_point_symbol="Dot",
        dimension_left_offset=10,
        dimension_right_offset=10,
        dimension_top_offset=10,
        dimension_bottom_offset=10,
        dimension_left_offset_increment=6,
        dimension_right_offset_increment=6,
        dimension_top_offset_increment=6,
        dimension_bottom_offset_increment=6,
        dimension_single_rebar_outer_dim=False,
        dimension_multi_rebar_outer_dim=True,
        dimension_single_rebar_text_position_type="StartOfLine",
        dimension_multi_rebar_text_position_type="MidOfLine",
    )
    for drawing_page in struct_drawing_page_dict.values():
        drawing_view = drawing_page.Views[0]
        drawing_view.setExpression(
            "LeftOffset",
            u".Template.Width.Value / 2 - .Width.Value * .Scale / 2",
        )
        drawing_view.setExpression(
            "TopOffset",
            u".Template.Height.Value / 2 - .Height.Value * .Scale / 2",
        )
        drawing_view.recompute(True)
        drawing_page.recompute(True)

Reinforcement Drawing

Usage

1. Open FreeCAD Model containing reinforcement bars created using Reinforcement Addon.

2. In FreeCAD Python console, copy the below code snippet to generate reinforcement drawing from different views for each Arch Structure element.

from ReinforcementDrawing.make_reinforcement_drawing import (
    makeStructuresReinforcementDrawing,
)

for view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    makeStructuresReinforcementDrawing(view=view)

ReinforcementDrawingView Object

A Rebars Drawing SVG View object.

Properties

  • DataStructure: The structure object acting as a Host for rebars to be included in the drawing.
  • DataRebars: The list of rebar objects to be included in the drawing.
  • DataView: The reinforcement drawing view to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
  • DataPositionType: The position type of Reinforcement Drawing on Template. It can be "Automatic" to calculate drawing placement using DataLeftOffset, DataTopOffset, DataMinRightOffset and DataMinBottomOffset OR "Custom" to set placement using DataX and DataY.
  • DataRebarsStrokeWidth: The stroke width of rebars in Reinforcement Drawing SVG.
  • DataRebarsColorStyle: The color style of rebars in Reinforcement Drawing SVG. Set it to "Automatic" to automatically select rebars color OR "Custom" to choose shape color value from DataRebarsColor.
  • DataRebarsColor: The color of rebars in Reinforcement Drawing SVG.
  • DataStructureStrokeWidth: The stroke width of the structure in Reinforcement Drawing SVG.
  • DataStructureColorStyle: The color style of structure in Reinforcement Drawing SVG. Set it to "Automatic" to automatically select rebars color, "Custom" to choose shape color value from DataStructureColor OR "None" to not fill structure.
  • DataStructureColor: The color of structure in Reinforcement Drawing SVG.
  • DataTemplate: The template for the Reinforcement Drawing view.
  • DataWidth: The width of the Reinforcement Drawing view SVG.
  • DataHeight: The height of Reinforcement Drawing view SVG.
  • DataLeftOffset: The left offset of Reinforcement Drawing view on a template.
  • DataTopOffset: The top offset of Reinforcement Drawing view on a template.
  • DataMinRightOffset: The minimum right offset of Reinforcement Drawing view on a template.
  • DataMinBottomOffset: The minimum bottom offset of Reinforcement Drawing view on a template.
  • DataMaxWidth: The maximum width of the Reinforcement Drawing view.
  • DataMaxHeight: The maximum height of the Reinforcement Drawing view.
  • DataVisibleRebars: The list of visible rebar objects in the drawing view.
  • DataDimensionLeftOffset: The left offset for each new ReinforcementDimensioning object.
  • DataDimensionRightOffset: The right offset for each new ReinforcementDimensioning object.
  • DataDimensionTopOffset: The top offset for each new ReinforcementDimensioning object.
  • DataDimensionBottomOffset: The bottom offset for each new ReinforcementDimensioning object.

Scripting

See also: Arch API, Reinforcement API and FreeCAD Scripting Basics.

The Reinforcement Drawing functions can be used in macros and from the Python console by using the following functions:

Create Reinforcement Drawing View

For one structure

from ReinforcementDrawing.make_reinforcement_drawing import (
    makeReinforcementDrawing,
)

reinforcement_drawing_page = makeReinforcementDrawing(
    structure,
    rebars_list,
    view,
    rebars_stroke_width,
    rebars_color_style,
    rebars_color,
    structure_stroke_width,
    structure_color_style,
    structure_color,
    drawing_left_offset,
    drawing_top_offset,
    drawing_min_right_offset,
    drawing_min_bottom_offset,
    drawing_max_width,
    drawing_max_height,
    template_file,
    dimension_left_offset,
    dimension_right_offset,
    dimension_top_offset,
    dimension_bottom_offset,
)
  • Creates a ReinforcementDrawingView object for the given structure and rebar objects list.
  • It returns the reinforcement_drawing_page of type TechDraw::DrawPage.
  • view specifies the view of drawing to be generated. It can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
  • rebars_stroke_width specifies the stroke-width of rebars in drawing SVG.
  • rebars_color_style specifies the color style of rebars. Set it to "Automatic" to automatically select rebars color or "Custom" to choose shape color value from variable rebars_color.
  • rebars_color specifies the fill color for rebars in drawing SVG.
   Format: (r, g, b)
   r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
   Make sure r, g, b must be float
   Example: (0.67, 0.0, 0.0)
  • structure_stroke_width specifies the stroke-width of structure in drawing SVG.
  • structure_color_style specifies the fill style of the structure. Set it to "Automatic" to automatically select structure color or "Custom" to choose structure color value from variable structure_color.
  • structure_color specifies the fill color for structure in drawing SVG. Format: (r, g, b)
  • drawing_left_offset specifies the left offset of the drawing view on template_file.
  • drawing_top_offset specifies the top offset of the drawing view on template_file.
  • drawing_min_right_offset specifies the minimum right offset of the drawing view on template_file.
  • drawing_min_bottom_offset specifies the minimum bottom offset of the drawing view on template_file.
  • drawing_max_width specifies the maximum width of drawing on template_file.
  • drawing_max_height specifies the maximum height of drawing on template_file.
  • template_file is the template file to be used for the reinforcement drawing page.
  • dimension_left_offset specifies the left offset of the dimension from drawing.
  • dimension_right_offset specifies the right offset of the dimension from drawing.
  • dimension_top_offset specifies the top offset of the dimension from drawing.
  • dimension_bottom_offset specifies the bottom offset of the dimension from drawing.
Example
from pathlib import Path
import FreeCAD, Draft, Arch
from ColumnReinforcement import TwoTiesSixRebars
from ReinforcementDrawing import make_reinforcement_drawing

Rect = Draft.makeRectangle(400, 400)
Structure = Arch.makeStructure(Rect, height=1600)
Structure.ViewObject.Transparency = 80
FreeCAD.ActiveDocument.recompute()

# Create Straight Rebars
RebarGroup = TwoTiesSixRebars.makeTwoTiesSixRebars(
    l_cover_of_ties=40,        
    r_cover_of_ties=40,
    t_cover_of_ties=40,
    b_cover_of_ties=40,
    offset_of_ties=100,
    bent_angle_of_ties=135,
    extension_factor_of_ties=2,
    dia_of_ties=8,
    number_spacing_check=True,
    number_spacing_value=10,
    dia_of_main_rebars=16,
    t_offset_of_rebars=40,
    b_offset_of_rebars=40,
    main_rebars_type="StraightRebar",
    hook_orientation="Top Inside",
    hook_extend_along="x-axis",
    l_rebar_rounding=None,
    hook_extension=None,
    ties_sequence=("Tie1", "Tie2"),
    structure=Structure,
    facename="Face6",
)

rebars = Draft.get_objects_of_type(FreeCAD.ActiveDocument.Objects, "Rebar")

# Create Reinforcement Drawing
for drawing_view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    make_reinforcement_drawing.makeReinforcementDrawing(
        structure=Structure,
        rebars_list=rebars,
        view=drawing_view,
        rebars_stroke_width=0.35,
        rebars_color_style="Automatic",
        rebars_color=(0.67, 0.0, 0.0),
        structure_stroke_width=0.5,
        structure_color_style="Automatic",
        structure_color=(0.3, 0.9, 0.91),
        drawing_left_offset=20,
        drawing_top_offset=20,
        drawing_min_right_offset=20,
        drawing_min_bottom_offset=20,
        drawing_max_width=0,                    # It is set to 0 to automatically set the default width based on other parameters
        drawing_max_height=0,                   # It is set to 0 to automatically set the default height based on other parameters
        template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
        dimension_left_offset=10,
        dimension_right_offset=10,
        dimension_top_offset=10,
        dimension_bottom_offset=10,
    )

For multiple structures

from ReinforcementDrawing.make_reinforcement_drawing import (
    makeStructuresReinforcementDrawing,
)

structure_drawing_page_dict = makeStructuresReinforcementDrawing(
    structure_list=None,
    rebars_list=None,
    view="Front",
    rebars_stroke_width=REBARS_STROKE_WIDTH,
    rebars_color_style=REBARS_COLOR_STYLE,
    rebars_color=REBARS_COLOR,
    structure_stroke_width=STRUCTURE_STROKE_WIDTH,
    structure_color_style=STRUCTURE_COLOR_STYLE,
    structure_color=STRUCTURE_COLOR,
    drawing_left_offset=DRAWING_LEFT_OFFSET,
    drawing_top_offset=DRAWING_TOP_OFFSET,
    drawing_min_right_offset=DRAWING_MIN_RIGHT_OFFSET,
    drawing_min_bottom_offset=DRAWING_MIN_BOTTOM_OFFSET,
    drawing_max_width=DRAWING_MAX_WIDTH,
    drawing_max_height=DRAWING_MAX_HEIGHT,
    template_file=TEMPLATE_FILE,
)
  • It returns structure_drawing_page_dict, a dictionary with structure as key and corresponding reinforcement drawing page as the value.
  • structure_list is the list of structural objects to generate their reinforcement drawing. If not provided, structures will be selected from the active document acting as Host for rebar objects.
  • rebars_list is the list of rebar objects to be included in the drawing. If not provided, rebars objects having Host in structure_list will be selected from the active document.
Example
from pathlib import Path
import FreeCAD, Draft, Arch
from ColumnReinforcement import TwoTiesSixRebars
from ReinforcementDrawing import make_reinforcement_drawing

Rect = Draft.makeRectangle(400, 400)
Structure1 = Arch.makeStructure(Rect, height=1600)
Structure1.ViewObject.Transparency = 80
Structure2 = Arch.makeStructure(Rect, height=1600)
Structure2.ViewObject.Transparency = 80
Structure2.Placement = FreeCAD.Placement(FreeCAD.Vector(1000, 0, 0), FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1), 0))
FreeCAD.ActiveDocument.recompute()

# Create Straight Rebars
TwoTiesSixRebars.makeTwoTiesSixRebars(
    l_cover_of_ties=40,        
    r_cover_of_ties=40,
    t_cover_of_ties=40,
    b_cover_of_ties=40,
    offset_of_ties=100,
    bent_angle_of_ties=135,
    extension_factor_of_ties=2,
    dia_of_ties=8,
    number_spacing_check=True,
    number_spacing_value=10,
    dia_of_main_rebars=16,
    t_offset_of_rebars=40,
    b_offset_of_rebars=40,
    main_rebars_type="StraightRebar",
    hook_orientation="Top Inside",
    hook_extend_along="x-axis",
    l_rebar_rounding=None,
    hook_extension=None,
    ties_sequence=("Tie1", "Tie2"),
    structure=Structure1,
    facename="Face6",
)

# Create LShaped Rebars with hook along x-axis
TwoTiesSixRebars.makeTwoTiesSixRebars(
    l_cover_of_ties=40,
    r_cover_of_ties=40,
    t_cover_of_ties=40,
    b_cover_of_ties=40,
    offset_of_ties=100,
    bent_angle_of_ties=135,
    extension_factor_of_ties=2,
    dia_of_ties=8,
    number_spacing_check=True,
    number_spacing_value=10,
    dia_of_main_rebars=16,
    t_offset_of_rebars=-40,
    b_offset_of_rebars=-40,
    main_rebars_type="LShapeRebar",
    hook_orientation="Top Outside",
    hook_extend_along="x-axis",
    l_rebar_rounding=2,
    hook_extension=40,
    ties_sequence=("Tie1", "Tie2"),
    structure=Structure2,
    facename="Face6",
)

# Create Reinforcement Drawing
for drawing_view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    make_reinforcement_drawing.makeStructuresReinforcementDrawing(
        structure_list=None,
        rebars_list=None,
        view=drawing_view,
        rebars_stroke_width=0.35,
        rebars_color_style="Automatic",
        rebars_color=(0.67, 0.0, 0.0),
        structure_stroke_width=0.5,
        structure_color_style="Automatic",
        structure_color=(0.3, 0.9, 0.91),
        drawing_left_offset=20,
        drawing_top_offset=20,
        drawing_min_right_offset=20,
        drawing_min_bottom_offset=20,
        drawing_max_width=0,                    # It is set to 0 to automatically set the default width based on other parameters
        drawing_max_height=0,                   # It is set to 0 to automatically set the default height based on other parameters
        template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
        dimension_left_offset=10,
        dimension_right_offset=10,
        dimension_top_offset=10,
        dimension_bottom_offset=10,
    )

Reinforcement Dimensioning

Usage

1. Open FreeCAD Model containing reinforcement bars created using Reinforcement Addon.

2. In FreeCAD Python console, copy the below code snippet to generate reinforcement drawing and dimensioning from different views for each Arch Structure element.

from ReinforcementDrawing.make_reinforcement_drawing import (
    makeStructuresReinforcementDrawing,
)

for view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    struct_drawing_page_dict = makeStructuresReinforcementDrawing(
        view=view, perform_dimensioning=True
    )
    for drawing_page in struct_drawing_page_dict.values():
        drawing_view = drawing_page.Views[0]
        drawing_view.setExpression(
            "LeftOffset",
            u".Template.Width.Value / 2 - .Width.Value * .Scale / 2",
        )
        drawing_view.setExpression(
            "TopOffset",
            u".Template.Height.Value / 2 - .Height.Value * .Scale / 2",
        )
        drawing_view.recompute(True)
        drawing_page.recompute(True)

ReinforcementDimensioning Object

A Rebar Dimensioning SVG View object.

Properties

  • DataParentDrawingView: The parent ReinforcementDrawingView object containing the drawing of Rebar object.
  • DataRebar: The Rebar object to perform dimensioning.
  • DataWayPointsType: The WayPoints type of dimension line. It can be "Automatic" (to automatically perform dimensioning of Rebar object) or "Custom" to use DataWayPoints to perform dimensioning.
  • DataWayPoints: A list of vector points to be used to generate a dimension line.
  • DataTextPositionType: The position type of dimension text. It can be "StartOfLine", "MidOfLine" or "EndOfLine".
  • DataDimensionFormat: The dimension label format.
   Example: "%M %C⌀%D,span=%S"
   Here: %M -> Rebar.Mark
         %C -> Rebar.Amount
         %D -> Rebar.Diameter
         %S -> Rebar span length
  • DataFont: The font family of dimension label.
  • DataFontSize: The font size of the dimension label.
  • DataStrokeWidth: The stroke width of the dimension line.
  • DataLineStyle: The stroke style of the dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
  • DataLineColor: The color of the dimension line.
  • DataTextColor: The color of the dimension label.
  • DataLineStartSymbol: The start symbol of the dimension line. It can be "FilledArrow", "Tick", "Dot" or "None".
  • DataLineEndSymbol: The end symbol of the dimension line. It can be "FilledArrow", "Tick", "Dot" or "None".
  • DataLineMidPointSymbol: The midpoints symbol of the dimension line. It can be "Tick", "Dot" or "None".
  • DataDimensionLeftOffset: The left offset for automated reinforcement dimensioning.
  • DataDimensionRightOffset: The right offset for automated reinforcement dimensioning.
  • DataDimensionTopOffset: The top offset for automated reinforcement dimensioning.
  • DataDimensionBottomOffset: The bottom offset for automated reinforcement dimensioning.
  • DataSingleRebar_LineStartSymbol: The dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None". It is used only when DataWayPointsType is set to "Automatic".
  • DataSingleRebar_LineEndSymbol: The dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None". It is used only when DataWayPointsType is set to "Automatic".
  • DataMultiRebar_LineStartSymbol: The dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None". It is used only when DataWayPointsType is set to "Automatic".
  • DataMultiRebar_LineEndSymbol: The dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None". It is used only when DataWayPointsType is set to "Automatic".
  • DataSingleRebar_OuterDimension: It specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible. It is used only when DataWayPointsType is set to "Automatic".
  • DataMultiRebar_OuterDimension: It specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible. It is used only when DataWayPointsType is set to "Automatic".
  • DataSingleRebar_TextPositionType: It specifies the dimension label position type, in case of single rebar is visible. It can be "StartOfLine", "MidOfLine" or "EndOfLine". It is used only when DataWayPointsType is set to "Automatic".
  • DataMultiRebar_TextPositionType: It specifies the dimension label position type, in case of multiple rebars are visible. It can be "StartOfLine", "MidOfLine" or "EndOfLine". It is used only when DataWayPointsType is set to "Automatic".

Scripting

See also: Arch API, Reinforcement API and FreeCAD Scripting Basics.

The Reinforcement Dimensioning functions can be used in macros and from the Python console by using the following functions:

Create Reinforcement Dimensioning Object

from ReinforcementDrawing.ReinforcementDimensioning import (
    makeReinforcementDimensioningObject,
)

dimension_object = makeReinforcementDimensioningObject(
    rebar,
    parent_drawing_view,
    drawing_page=None,
    dimension_label_format="%M %C⌀%D,span=%S",
    dimension_font_family="DejaVu Sans",
    dimension_font_size=3,
    dimension_stroke_width=0.25,
    dimension_line_style="Continuous",
    dimension_line_color=(0.0, 0.0, 0.50),
    dimension_text_color=(0.0, 0.33, 0.0),
    dimension_single_rebar_line_start_symbol="None",
    dimension_single_rebar_line_end_symbol="FilledArrow",
    dimension_multi_rebar_line_start_symbol="FilledArrow",
    dimension_multi_rebar_line_end_symbol="FilledArrow",
    dimension_line_mid_point_symbol="Dot",
    dimension_left_offset_increment=10,
    dimension_right_offset_increment=10,
    dimension_top_offset_increment=10,
    dimension_bottom_offset_increment=10,
    dimension_single_rebar_outer_dim=False,
    dimension_multi_rebar_outer_dim=True,
    dimension_single_rebar_text_position_type="StartOfLine",
    dimension_multi_rebar_text_position_type="MidOfLine",
)
  • Creates and returns a ReinforcementDimensioning object for the given rebar object.
  • parent_drawing_view is the ReinforcementDrawingView object containing a drawing of rebar object.
  • drawing_page is the object of type TechDraw::DrawPage used to show parent_drawing_view.
  • dimension_label_format is the format used for the dimension label.
   Example: "%M %C⌀%D,span=%S"
   Here: %M -> Rebar.Mark
         %C -> Rebar.Amount
         %D -> Rebar.Diameter
         %S -> Rebar span length
  • dimension_font_family is the font family of dimension label.
  • dimension_font_size is the font size of the dimension label.
  • dimension_stroke_width is the stroke-width of dimension line.
  • dimension_line_style is the stroke style of dimension line. It can be "Continuous", "Dash", "Dot", "DashDot" or "DashDotDot".
  • dimension_line_color is the color of the dimension line.
   Format: (r, g, b)
   r, g, b value should be between 0 to 1, so you may need to divide the value of r, g, b by 255 to get its value between 0 to 1
   Make sure r, g, b must be float
  • dimension_text_color is the color of the dimension label.
  • dimension_single_rebar_line_start_symbol is the dimension line start symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_single_rebar_line_end_symbol is the dimension line end symbol, in case of single rebar is visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_multi_rebar_line_start_symbol is the dimension line start symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_multi_rebar_line_end_symbol is the dimension line end symbol, in case of multiple rebars are visible. It can be "FilledArrow", "Tick", "Dot" or "None".
  • dimension_line_mid_point_symbol is the dimension line midpoints symbol. It can be "Tick", "Dot" or "None".
  • dimension_left_offset_increment is the increment in the left offset to move each new dimension label away from drawing.
  • dimension_right_offset_increment is the increment in the right offset to move each new dimension label away from drawing.
  • dimension_top_offset_increment is the increment in the top offset to move each new dimension label away from drawing.
  • dimension_bottom_offset_increment is the increment in the bottom offset to move each new dimension label away from drawing.
  • dimension_single_rebar_outer_dim specifies if dimension lines are to be outside of reinforcement drawing, in case of single rebar is visible.
  • dimension_multi_rebar_outer_dim specifies if dimension lines are to be outside of reinforcement drawing, in case of multiple rebars are visible.
  • dimension_single_rebar_text_position_type specifies the dimension label position type, in case of single rebar is visible. It can be "StartOfLine", "MidOfLine" or "EndOfLine".
  • dimension_multi_rebar_text_position_type specifies the dimension label position type, in case of multiple rebars are visible. It can be "StartOfLine", "MidOfLine" or "EndOfLine".
Example
from pathlib import Path
import FreeCAD, Draft, Arch
from ColumnReinforcement import TwoTiesSixRebars
from ReinforcementDrawing import make_reinforcement_drawing
from ReinforcementDrawing.ReinforcementDimensioning import (
    makeReinforcementDimensioningObject,
)

Rect = Draft.makeRectangle(400, 400)
Structure = Arch.makeStructure(Rect, height=1600)
Structure.ViewObject.Transparency = 80
FreeCAD.ActiveDocument.recompute()

# Create Straight Rebars
TwoTiesSixRebars.makeTwoTiesSixRebars(
    l_cover_of_ties=40,        
    r_cover_of_ties=40,
    t_cover_of_ties=40,
    b_cover_of_ties=40,
    offset_of_ties=100,
    bent_angle_of_ties=135,
    extension_factor_of_ties=2,
    dia_of_ties=8,
    number_spacing_check=True,
    number_spacing_value=10,
    dia_of_main_rebars=16,
    t_offset_of_rebars=40,
    b_offset_of_rebars=40,
    main_rebars_type="StraightRebar",
    hook_orientation="Top Inside",
    hook_extend_along="x-axis",
    l_rebar_rounding=None,
    hook_extension=None,
    ties_sequence=("Tie1", "Tie2"),
    structure=Structure,
    facename="Face6",
)

rebars = Draft.get_objects_of_type(FreeCAD.ActiveDocument.Objects, "Rebar")

# Create Reinforcement Drawing
drawing_page = make_reinforcement_drawing.makeReinforcementDrawing(
    structure=Structure,
    rebars_list=rebars,
    view="Front",
    rebars_stroke_width=0.35,
    rebars_color_style="Automatic",
    rebars_color=(0.67, 0.0, 0.0),
    structure_stroke_width=0.5,
    structure_color_style="Automatic",
    structure_color=(0.3, 0.9, 0.91),
    drawing_left_offset=20,
    drawing_top_offset=20,
    drawing_min_right_offset=20,
    drawing_min_bottom_offset=20,
    drawing_max_width=0,                    # It is set to 0 to automatically set the default width based on other parameters
    drawing_max_height=0,                   # It is set to 0 to automatically set the default height based on other parameters
    template_file=str(Path(make_reinforcement_drawing.__file__).parent.absolute() / "Templates" / "A4_Landscape_blank.svg"),
    dimension_left_offset=10,
    dimension_right_offset=10,
    dimension_top_offset=10,
    dimension_bottom_offset=10,
)

visible_rebars = drawing_page.Views[0].VisibleRebars

# Create Reinforcement Dimensioning for single rebar
makeReinforcementDimensioningObject(
    visible_rebars[0],
    parent_drawing_view,
    drawing_page=None,
    dimension_label_format="%M %C⌀%D,span=%S",
    dimension_font_family="DejaVu Sans",
    dimension_font_size=3,
    dimension_stroke_width=0.25,
    dimension_line_style="Continuous",
    dimension_line_color=(0.0, 0.0, 0.50),
    dimension_text_color=(0.0, 0.33, 0.0),
    dimension_single_rebar_line_start_symbol="None",
    dimension_single_rebar_line_end_symbol="FilledArrow",
    dimension_multi_rebar_line_start_symbol="FilledArrow",
    dimension_multi_rebar_line_end_symbol="FilledArrow",
    dimension_line_mid_point_symbol="Dot",
    dimension_left_offset_increment=10,
    dimension_right_offset_increment=10,
    dimension_top_offset_increment=10,
    dimension_bottom_offset_increment=10,
    dimension_single_rebar_outer_dim=False,
    dimension_multi_rebar_outer_dim=True,
    dimension_single_rebar_text_position_type="StartOfLine",
    dimension_multi_rebar_text_position_type="MidOfLine",
)

# Create Reinforcement Dimensioning for all visible rebars in drawing view
for visible_rebar in visible_rebars:
    makeReinforcementDimensioningObject(
        visible_rebar,
        parent_drawing_view,
        drawing_page=None,
        dimension_label_format="%M %C⌀%D,span=%S",
        dimension_font_family="DejaVu Sans",
        dimension_font_size=3,
        dimension_stroke_width=0.25,
        dimension_line_style="Continuous",
        dimension_line_color=(0.0, 0.0, 0.50),
        dimension_text_color=(0.0, 0.33, 0.0),
        dimension_single_rebar_line_start_symbol="None",
        dimension_single_rebar_line_end_symbol="FilledArrow",
        dimension_multi_rebar_line_start_symbol="FilledArrow",
        dimension_multi_rebar_line_end_symbol="FilledArrow",
        dimension_line_mid_point_symbol="Dot",
        dimension_left_offset_increment=10,
        dimension_right_offset_increment=10,
        dimension_top_offset_increment=10,
        dimension_bottom_offset_increment=10,
        dimension_single_rebar_outer_dim=False,
        dimension_multi_rebar_outer_dim=True,
        dimension_single_rebar_text_position_type="StartOfLine",
        dimension_multi_rebar_text_position_type="MidOfLine",
    )