Exemplo n.º 1
0
 def __init__(self, obj):
     """Add properties to object obj."""
     self.Object = obj.rebar_group
     self.ties_group = obj.ties_group
     properties = [("App::PropertyStringList", "TiesSequence",
                    "Sequence of ties", 1)]
     setGroupProperties(properties, obj.ties_group)
Exemplo n.º 2
0
 def __init__(self, obj):
     """Add properties to object obj."""
     self.Object = obj.rebar_group
     self.sec_rebars_group = self.Object.newObject(
         "App::DocumentObjectGroupPython", "SecondaryRebars"
     )
     self.xdir_rebars_group = self.sec_rebars_group.newObject(
         "App::DocumentObjectGroupPython", "XDirRebars"
     )
     self.ydir_rebars_group = self.sec_rebars_group.newObject(
         "App::DocumentObjectGroupPython", "YDirRebars"
     )
     # Add secondary rebars group object to list of rebars groups of rebar
     # group object
     prev_rebar_groups = obj.rebar_group.RebarGroups
     prev_rebar_groups.append(self.sec_rebars_group)
     obj.rebar_group.RebarGroups = prev_rebar_groups
     # Add and set properties for secondary rebars group object
     properties = [
         (
             "App::PropertyLinkList",
             "SecondaryRebars",
             "List of secondary rebars",
             1,
         )
     ]
     setGroupProperties(properties, self.sec_rebars_group)
     self.sec_rebars_group.SecondaryRebars = [
         self.xdir_rebars_group,
         self.ydir_rebars_group,
     ]
     # Add properties to xdir rebars group object
     properties = [
         ("App::PropertyLinkList", "XDirRebars", "List of xdir rebars", 1),
         ("App::PropertyString", "RebarType", "Type of xdir rebars", 1),
         (
             "App::PropertyString",
             "HookOrientation",
             "Orientation of LShaped Rebar Hook",
             1,
         ),
         ("App::PropertyDistance", "HookExtension", "Length of hook", 1),
         (
             "App::PropertyDistance",
             "TopOffset",
             "Top offset of xdir rebars",
             1,
         ),
         (
             "App::PropertyDistance",
             "BottomOffset",
             "Bottom offset of xdir rebars",
             1,
         ),
         (
             "App::PropertyString",
             "NumberDiameter",
             "Number Diameter list of rebars",
             1,
         ),
     ]
     setGroupProperties(properties, self.xdir_rebars_group)
     # Add properties to ydir rebars group object
     properties = [
         ("App::PropertyLinkList", "YDirRebars", "List of ydir rebars", 1),
         ("App::PropertyString", "RebarType", "Type of ydir rebars", 1),
         (
             "App::PropertyString",
             "HookOrientation",
             "Orientation of LShaped Rebar Hook",
             1,
         ),
         ("App::PropertyDistance", "HookExtension", "Length of hook", 1),
         (
             "App::PropertyDistance",
             "TopOffset",
             "Top offset of ydir rebars",
             1,
         ),
         (
             "App::PropertyDistance",
             "BottomOffset",
             "Bottom offset of ydir rebars",
             1,
         ),
         (
             "App::PropertyString",
             "NumberDiameter",
             "Number Diameter list of rebars",
             1,
         ),
     ]
     setGroupProperties(properties, self.ydir_rebars_group)
Exemplo n.º 3
0
    def __init__(self):
        self.Type = "RebarGroup"
        self.rebar_group = FreeCAD.ActiveDocument.addObject(
            "App::DocumentObjectGroupPython", "ColumnReinforcement")
        self.helical_rebar_group = self.rebar_group.newObject(
            "App::DocumentObjectGroupPython", "HelicalRebars")
        self.main_rebars_group = self.rebar_group.newObject(
            "App::DocumentObjectGroupPython", "MainRebars")

        # Add properties to rebar_group object
        properties = []
        properties.append((
            "App::PropertyString",
            "ColumnType",
            "Type of column reinforcement",
            1,
        ))
        properties.append(("App::PropertyLinkList", "RebarGroups",
                           "List of rebar groups", 1))
        setGroupProperties(properties, self.rebar_group)
        self.rebar_group.ColumnType = "CircularColumn"
        self.rebar_group.RebarGroups = [
            self.helical_rebar_group,
            self.main_rebars_group,
        ]

        # Add properties to helical_rebar_group object
        properties = []
        properties.append((
            "App::PropertyLinkList",
            "HelicalRebars",
            "List of helical rebars",
            1,
        ))
        setGroupProperties(properties, self.helical_rebar_group)

        # Add properties to main_rebars_group object
        properties = []
        properties.append(
            ("App::PropertyLinkList", "MainRebars", "List of main rebars", 1))
        properties.append((
            "App::PropertyDistance",
            "TopOffset",
            "Top offset of main rebars",
            1,
        ))
        properties.append((
            "App::PropertyDistance",
            "BottomOffset",
            "Bottom offset of main rebars",
            1,
        ))
        properties.append(("App::PropertyDistance", "Diameter",
                           "Diameter of main rebars", 1))
        properties.append((
            "App::PropertyBool",
            "NumberAngleCheck",
            "Number radio button is checked",
            1,
        ))
        properties.append(
            ("App::PropertyQuantity", "Number", "Number of main rebars", 1))
        properties.append((
            "App::PropertyAngle",
            "Angle",
            "Angle between consecutive main rebars",
            1,
        ))
        setGroupProperties(properties, self.main_rebars_group)

        self.Object = self.rebar_group
Exemplo n.º 4
0
    def __init__(self):
        """Create Group object and add properties to it."""
        _RebarGroup.__init__(self, "ColumnReinforcement")
        # Add properties to group of rebars
        # Syntax to add new property:
        # properties.append(
        #     (
        #         "<property_type>",
        #         "<property_name>",
        #         "<property_description>",
        #         "<property_value>",
        #         "<property_editor_mode>",
        #     )
        #
        # property_editor_mode:
        # 0 -- read and write mode
        # 1 -- read-only mode
        # 2 -- hidden mode

        properties = []
        properties.append(
            (
                "App::PropertyString",
                "ColumnType",
                "Type of column reinforcement",
                1,
            )
        )
        setGroupProperties(properties, self.rebar_group)
        self.rebar_group.ColumnType = "RectangularColumn"

        # Add properties to ties group object
        properties = []
        properties.append(
            (
                "App::PropertyString",
                "TiesConfiguration",
                "Configuration of Ties in Column Reinforcement",
                1,
            )
        )
        properties.append(("App::PropertyLinkList", "Ties", "List of ties", 1))
        properties.append(
            ("App::PropertyDistance", "LeftCover", "Left cover of ties", 1)
        )
        properties.append(
            ("App::PropertyDistance", "RightCover", "Right cover of ties", 1)
        )
        properties.append(
            ("App::PropertyDistance", "TopCover", "Top cover of ties", 1)
        )
        properties.append(
            ("App::PropertyDistance", "BottomCover", "Bottom cover of ties", 1)
        )
        setGroupProperties(properties, self.ties_group)

        # Add properties to main rebars group object
        properties = []
        properties.append(
            ("App::PropertyString", "RebarType", "Type of main rebars", 1)
        )
        properties.append(
            ("App::PropertyLinkList", "MainRebars", "List of main rebars", 1)
        )
        properties.append(
            ("App::PropertyDistance", "TopOffset", "Top offset of rebars", 1)
        )
        properties.append(
            (
                "App::PropertyDistance",
                "BottomOffset",
                "Bottom offset of rebars",
                1,
            )
        )
        properties.append(
            (
                "App::PropertyString",
                "HookOrientation",
                "Orientation of LShaped Rebar Hook",
                1,
            )
        )
        properties.append(
            (
                "App::PropertyString",
                "HookExtendAlong",
                "Direction of hook extension",
                1,
            )
        )
        properties.append(
            ("App::PropertyDistance", "HookExtension", "Length of hook", 1)
        )
        setGroupProperties(properties, self.main_rebars_group)