dragonfly.cli.create module

dragonfly model creation commands.

dragonfly.cli.create.from_geojson(geojson, location=None, point=None, window_ratio=None, all_to_buildings=False, existing_to_context=False, no_separation=False, units='Meters', tolerance=None, output_file=None, buildings_only=True, no_context=True, separate_top_bottom=True)[source]

Create a Dragonfly model from a geojson file with building footprints.

Parameters:
  • geojson – Full path to a geoJSON file with building footprints as Polygons or MultiPolygons.

  • location – An optional latitude and longitude, formatted as two floats separated by a comma, (eg. “42.3601,-71.0589”), defining the origin of the geojson file. If None, the origin is autocalculated as the bottom-left corner of the bounding box of all building footprints in the geojson file.

  • point – An optional X and Y coordinate, formatted as two floats separated by a comma, (eg. “200,200”), defining the origin of the geojson file in the space of the dragonfly model. The coordinates of this point are expected to be in the expected units of this Model.

  • window_ratio – A number between 0 and 1 (but not equal to 1) for the ratio between aperture area and wall area to be applied to all walls of all buildings. If specified, this will override the window_ratio key in the geojson.

  • all_to_buildings – Boolean to indicate if all geometries in the geojson file should be considered buildings. If buildings-only, this method will only generate footprints from geometries that are defined as a “Building” in the type field of its corresponding properties.

  • existing_to_context – Boolean to indicate whether polygons possessing a building_status of “Existing” under their properties should be imported as ContextShade instead of Building objects.

  • no_separation – Boolean to indicate whether polygons possessing a building_status of “Existing” under their properties should be imported as ContextShade instead of Building objects.

  • units – Text for the units system in which the resulting model geometry should be. Must be (Meters, Millimeters, Feet, Inches, Centimeters).

  • tolerance – The maximum difference between x, y, and z values at which vertices are considered equivalent.

  • output_file – Optional file to output the Model JSON string. If None, The string will be returned from this method.

dragonfly.cli.create.from_honeybee(base_model, conversion_method='ExtrudedOnly', other_model=(), output_file=None)[source]

Create a Dragonfly Model from Honeybee Model(s).

Parameters:
  • base_model – Full path to a Honeybee Model JSON or Pkl file that serves as the base for the resulting Dragonfly Model. This model determines the units and tolerance of the output model.

  • conversion_method – Text to indicate how the Honeybee Rooms should be converted to Dragonfly. Choose from: AllRoom2D, ExtrudedOnly, AllRoom3D. Note that the AllRoom2D option may result in some loss or simplification of the 3D Honeybee geometry but ensures that all of the Dragonfly features for editing the rooms can be used. The ExtrudedOnly method will convert only the 3D Rooms that would have no loss or simplification of geometry when converted to Room2D. AllRoom3D keeps all detailed 3D geometry on the Building.room_3ds property, enabling you to convert the 3D Rooms to Room2D using the Building.convert_room_3ds_to_2d() method as you see fit.

  • other_model – An optional list of other Honeybee Models to be added as a separate Building in the resulting Dragonfly Model.

  • output_file – Optional file to output the Model DFJSON string. If None, the string will be returned from this method. (Default: None).

dragonfly.cli.create.merge_models(base_model, other_model=(), output_file=None)[source]

Create a Dragonfly Model by merging multiple models together.

Parameters:
  • base_model – Full path to a Dragonfly Model JSON or Pkl file that serves as the base into which the other model(s) will be merged. This model determines the units and tolerance of the output model.

  • other_model – A list of other Dragonfly Models to be merged into the base model.

  • output_file – Optional file to output the Model DFJSON string. If None, the string will be returned from this method. (Default: None).