Example #1
0
    def onChanged(self, obj, prop):
        ComponentStructural.onChanged(self, obj, prop)

        if prop == 'Area':
            obj.Proxy.area = obj.Area

        elif prop == 'Thickness':
            obj.Proxy.thickness = obj.Thickness

        elif prop == 'Length':
            obj.Proxy.length = obj.Length

        elif prop == 'Width':
            obj.Proxy.width = obj.Width

        if prop == 'Shape':
            box = obj.Shape.BoundBox
            dim = [box.XLength, box.YLength, box.ZLength]
            smallest = min(dim)
            largest = max(dim)

            obj.Length = largest
            dim.remove(smallest)
            dim.remove(largest)
            obj.Width = dim[0]
Example #2
0
    def onChanged(self, obj, prop):
        ComponentStructural.onChanged(self, obj, prop)

        if prop == "Area":
            obj.Proxy.area = obj.Area

        elif prop == "Thickness":
            obj.Proxy.thickness = obj.Thickness

        elif prop == "Length":
            obj.Proxy.length = obj.Length

        elif prop == "Width":
            obj.Proxy.width = obj.Width

        if prop == "Shape":
            box = obj.Shape.BoundBox
            dim = [box.XLength, box.YLength, box.ZLength]
            smallest = min(dim)
            largest = max(dim)

            obj.Length = largest
            dim.remove(smallest)
            dim.remove(largest)
            obj.Width = dim[0]
Example #3
0
    def __init__(self, obj, material, part):
        ComponentStructural.__init__(self, obj, material, part)

        obj.addProperty("App::PropertyLength", "Length", "Beam", "Length of the beam")
        obj.setEditorMode("MaxLength", 1)

        obj.addProperty("App::PropertyFloat", "CrossSection", "Beam", "Cross section of the beam")
        obj.setEditorMode("CrossSection", 1)

        obj.addProperty("App::PropertyFloat", "MassPerArea", "Beam", "Mass per unit area")
        obj.setEditorMode("MassPerArea", 1)
        obj.addProperty("App::PropertyFloat", "AreaMoment", "Beam", "Area moment of inertia")
        obj.setEditorMode("AreaMoment", 1)

        self.SubsystemLong = obj.makeSubsystem(SubsystemLong())
        self.SubsystemBend = obj.makeSubsystem(SubsystemBend())
        self.SubsystemShear = obj.makeSubsystem(SubsystemShear())
Example #4
0
    def __init__(self, obj, system, material, part):

        obj.addProperty("App::PropertyFloat", "Length", self.name, "Length of the plate.")
        obj.setEditorMode("Length", 1)
        obj.addProperty("App::PropertyFloat", "Width", self.name, "Width of the plate.")
        obj.setEditorMode("Width", 1)
        ComponentStructural.__init__(self, obj, system, material, part)

        obj.addProperty("App::PropertyFloat", "Area", self.name, "Area of the plate.")
        obj.setEditorMode("Area", 1)
        obj.addProperty("App::PropertyFloat", "Thickness", self.name, "Thickness of the plate.")
        obj.setEditorMode("Thickness", 1)
        obj.addProperty("App::PropertyFloat", "MassPerArea", self.name, "Mass per unit area.")
        obj.setEditorMode("MassPerArea", 1)
        self.calc_area_and_thickness(obj)

        self.SubsystemLong = obj.makeSubsystem(SubsystemLong)
        self.SubsystemBend = obj.makeSubsystem(SubsystemBend)
        self.SubsystemShear = obj.makeSubsystem(SubsystemShear)
Example #5
0
    def __init__(self, obj, material, part):
        ComponentStructural.__init__(self, obj, material, part)

        obj.addProperty("App::PropertyLength", "Length", "Beam",
                        "Length of the beam")
        obj.setEditorMode("MaxLength", 1)

        obj.addProperty("App::PropertyFloat", "CrossSection", "Beam",
                        "Cross section of the beam")
        obj.setEditorMode("CrossSection", 1)

        obj.addProperty("App::PropertyFloat", "MassPerArea", "Beam",
                        "Mass per unit area")
        obj.setEditorMode("MassPerArea", 1)
        obj.addProperty("App::PropertyFloat", "AreaMoment", "Beam",
                        "Area moment of inertia")
        obj.setEditorMode("AreaMoment", 1)

        self.SubsystemLong = obj.makeSubsystem(SubsystemLong())
        self.SubsystemBend = obj.makeSubsystem(SubsystemBend())
        self.SubsystemShear = obj.makeSubsystem(SubsystemShear())
Example #6
0
    def __init__(self, obj, system, material, part):

        obj.addProperty("App::PropertyFloat", "Length", self.name,
                        "Length of the plate.")
        obj.setEditorMode("Length", 1)
        obj.addProperty("App::PropertyFloat", "Width", self.name,
                        "Width of the plate.")
        obj.setEditorMode("Width", 1)
        ComponentStructural.__init__(self, obj, system, material, part)

        obj.addProperty("App::PropertyFloat", "Area", self.name,
                        "Area of the plate.")
        obj.setEditorMode("Area", 1)
        obj.addProperty("App::PropertyFloat", "Thickness", self.name,
                        "Thickness of the plate.")
        obj.setEditorMode("Thickness", 1)
        obj.addProperty("App::PropertyFloat", "MassPerArea", self.name,
                        "Mass per unit area.")
        obj.setEditorMode("MassPerArea", 1)
        self.calc_area_and_thickness(obj)

        self.SubsystemLong = obj.makeSubsystem(SubsystemLong)
        self.SubsystemBend = obj.makeSubsystem(SubsystemBend)
        self.SubsystemShear = obj.makeSubsystem(SubsystemShear)
Example #7
0
    def execute(self, obj):
        ComponentStructural.execute(self, obj)
        self.calc_area_and_thickness(obj)

        obj.MassPerArea = obj.Proxy.mass_per_area
Example #8
0
    def execute(self, obj):
        ComponentStructural.execute(self, obj)

        obj.Length = obj.Proxy.model.length
        obj.AreaMoment = obj.Proxy.model.area_moment_of_inertia
        obj.CrossSection = obj.Proxy.model.cross_section
Example #9
0
    def onChanged(self, obj, prop):
        ComponentStructural.onChanged(self, obj, prop)

        if prop == "Length":
            obj.Proxy.model.length = obj.Length
Example #10
0
    def execute(self, obj):
        ComponentStructural.execute(self, obj)
        self.calc_area_and_thickness(obj)

        obj.MassPerArea = obj.Proxy.mass_per_area
Example #11
0
    def execute(self, obj):
        ComponentStructural.execute(self, obj)

        obj.Length = obj.Proxy.model.length
        obj.AreaMoment = obj.Proxy.model.area_moment_of_inertia
        obj.CrossSection = obj.Proxy.model.cross_section
Example #12
0
    def onChanged(self, obj, prop):
        ComponentStructural.onChanged(self, obj, prop)

        if prop == 'Length':
            obj.Proxy.model.length = obj.Length