def test_model_properties_setability(): """Test the setting of properties on the Model.""" pts_1 = (Point3D(0, 0, 3), Point3D(0, 10, 3), Point3D(10, 10, 3), Point3D(10, 0, 3)) pts_2 = (Point3D(10, 0, 3), Point3D(10, 10, 3), Point3D(20, 10, 3), Point3D(20, 0, 3)) pts_3 = (Point3D(0, 10, 3), Point3D(0, 20, 3), Point3D(10, 20, 3), Point3D(10, 10, 3)) pts_4 = (Point3D(10, 10, 3), Point3D(10, 20, 3), Point3D(20, 20, 3), Point3D(20, 10, 3)) room2d_1 = Room2D('Office1', Face3D(pts_1), 3) room2d_2 = Room2D('Office2', Face3D(pts_2), 3) room2d_3 = Room2D('Office3', Face3D(pts_3), 3) room2d_4 = Room2D('Office4', Face3D(pts_4), 3) story = Story('OfficeFloor', [room2d_1, room2d_2, room2d_3, room2d_4]) story.solve_room_2d_adjacency(0.01) story.set_outdoor_window_parameters(SimpleWindowRatio(0.4)) story.multiplier = 4 building = Building('OfficeBuilding', [story]) model = Model('NewDevelopment', [building]) model.to_rectangular_windows() model.display_name = 'TestBuilding' assert model.display_name == 'TestBuilding' model.units = 'Feet' assert model.units == 'Feet' model.tolerance = 0.1 assert model.tolerance == 0.1 model.angle_tolerance = 0.01 assert model.angle_tolerance == 0.01 model.tolerance = 0.01 assert model.tolerance == 0.01
try: # import the core honeybee dependencies from honeybee.typing import clean_string except ImportError as e: raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e)) try: # import the core dragonfly dependencies from dragonfly.model import Model except ImportError as e: raise ImportError('\nFailed to import dragonfly:\n\t{}'.format(e)) try: from ladybug_rhino.grasshopper import all_required_inputs from ladybug_rhino.config import units_system, tolerance, angle_tolerance except ImportError as e: raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e)) if all_required_inputs(ghenv.Component): # set a default name name = clean_string(_name_) if _name_ is not None else 'unnamed' units = units_system() # create the model model = Model(name, _buildings, context_, units=units, tolerance=tolerance, angle_tolerance=angle_tolerance) if _name_ is not None: model.display_name = _name_