edit

dragonfly edit

Commands for editing Dragonfly models.

dragonfly edit [OPTIONS] COMMAND [ARGS]...

align

Move Room2D vertices within a given distance of a line or ray to be on that line.

By default, all Stories in the Model will be aligned but the input line-ray-file can be structured to only specify line-rays for specific stories if desired.

Args:
model_file: Full path to a Model JSON or Pkl file.
line_ray_file: Full path to a JSON file containing an array of ladybug_geometry
Ray2D or LineSegment2D objects to which the Room2D vertices will be
aligned. Ray2Ds will be interpreted as being infinite in both directions
while LineSegment2Ds will be interpreted as only existing between two points.
This JSON can also be a dictionary where the keys are the identifiers
of Stories in the Model and the values are arrays of Ray2D or LineSegment2D
objects to be applied only to that Story. This dictionary can also contain
an __all__ key, which can contain a list of Ray2D or LineSegment2D to be
applied to all Stories in the Model.
dragonfly edit align [OPTIONS] MODEL_FILE LINE_RAY_FILE

Options

-d, --distance <distance>

A number for the maximum distance between a vertex and the line_ray where the vertex will be moved to lie on the line_ray. Vertices beyond this distance will be left as they are. This input can include the units of the distance (eg. 3ft) or, if no units are provided, the value will be interpreted in the dragonfly model units.

Default

0.5m

-r, --remove-distance <remove_distance>

An optional number for the maximum length of a segment below which the segment will be removed. This operation is performed before the alignment. This input can include the units of the distance (eg. 3ft) or, if no units are provided, the value will be interpreted in the dragonfly model units.

--keep-colinear, -c, --merge-colinear

Flag to note whether colinear wall segments of the resulting Room2Ds should be merged with one another after the alignment has been performed.

Default

True

-f, --output-file <output_file>

Optional file to output the Model JSON string with aligned Room2Ds. By default it will be printed out to stdout

-log, --log-file <log_file>

Optional file to output the list of any Room2Ds that became degenerate and were deleted after alignment. By default it will be printed out to stdout

Arguments

MODEL_FILE

Required argument

LINE_RAY_FILE

Required argument

convert-units

Convert a Model to a given units system.

Args:
model_file: Full path to a Model JSON or Pkl file.
units: Text for the units system to which the model will be converted.
Choose from (Meters, Millimeters, Feet, Inches, Centimeters).
dragonfly edit convert-units [OPTIONS] MODEL_FILE UNITS

Options

--scale, -ns, --do-not-scale

Flag to note whether the model should be scaled as it is converted to the new units system.

Default

True

-f, --output-file <output_file>

Optional file to output the Model JSON string with solved adjacency. By default it will be printed out to stdout

Arguments

MODEL_FILE

Required argument

UNITS

Required argument

remove-short-segments

Remove consecutive short segments on a Model’s Room2Ds.

Args:
model_file: Full path to a Model JSON or Pkl file.
dragonfly edit remove-short-segments [OPTIONS] MODEL_FILE

Options

-d, --distance <distance>

The maximum length of a segment below which the segment will be considered for removal. This input can include the units of the distance (eg. 3ft) or, if no units are provided, the value will be interpreted in the dragonfly model units.

Default

0.5m

-f, --output-file <output_file>

Optional file to output the Model JSON string with aligned Room2Ds. By default it will be printed out to stdout

-log, --log-file <log_file>

Optional file to output the list of any Room2Ds that became degenerate and were deleted after alignment. By default it will be printed out to stdout

Arguments

MODEL_FILE

Required argument

reset-room-boundaries

Rebuild the Room2Ds of a Model using boundary Polygons.

All existing properties of segments along the boundary polygons will be preserved, including all window geometries. By default, the largest room that is identified within each of the boundary polygons will determine the extension properties of the resulting Room2D.

Args:
model_file: Full path to a Dragonfly Model JSON or Pkl file.
polygon_file: Full path to a JSON file containing an array of ladybug_geometry
Polygon2D objects to which the Room2D segments will be reset. The array
of Polygon2Ds can contain both outer boundaries and holes in the floor
plate and this command will automatically distinguish holes from boundaries.
This JSON can also be a dictionary where the keys are the identifiers
of Stories in the Model and the values are arrays of Polygon2D objects
to be applied only to that Story. This dictionary can also contain
an __all__ key, which can contain a list of Polygon2D to be applied to
all Stories in the Model. Any Polygon2D JSON objects that contain
“identifier” or “display_name” properties will be used to determine the
identifier and display_name of the resulting Room2D. Otherwise, these
identifiers are taken from the largest existing Room2D inside each polygon.
Any Polygon2D JSON objects that contain a “floor_to_ceiling_height”
property will be used to determine the floor_to_ceiling_height of
the resulting Room2D. Otherwise, it will be the maximum of the Room2Ds
that are found inside the polygon, which ensures that all window
geometries are included in the output. If the specified height is
lower than the maximum Room2D height, any detailed windows will be
automatically trimmed to accommodate the new floor-to-ceiling height.
dragonfly edit reset-room-boundaries [OPTIONS] MODEL_FILE POLYGON_FILE

Options

-d, --distance <distance>

A number for the maximum distance between a vertex and the polygon where the vertex will be moved to lie on the polygon. Setting this to zero assumes that all relevant Room2D segments are completely colinear with the polygons within the Model tolerance. This input can include the units of the distance (eg. 1ft) or, if no units are provided, the value will be interpreted in the dragonfly model units.

Default

0.15m

--keep-colinear, -c, --merge-colinear

Flag to note whether colinear wall segments of the resulting Room2Ds should be merged with one another after the room boundaries have been reset. This is particularly helpful when the input polygon file represents an exterior envelope.

Default

True

-f, --output-file <output_file>

Optional file to output the Model JSON string with aligned Room2Ds. By default it will be printed out to stdout

Arguments

MODEL_FILE

Required argument

POLYGON_FILE

Required argument

solve-adjacency

Solve adjacency between Room2Ds of a Model JSON file.

This involves setting Surface or Adiabatic boundary conditions for all matching segments across each Story.

If the –intersect option is selected, this will involve involve the following.
1. Remove colinear vertices from the Room2D polygons.
2. Intersect adjacent segments of the same Story with one another.
Note that the –intersect option removes all existing boundary_conditions,
window_parameters, and shading_parameters.
Args:
model_file: Full path to a Model JSON or Pkl file.
dragonfly edit solve-adjacency [OPTIONS] MODEL_FILE

Options

--surface, -a, --adiabatic

Flag to note whether the adjacencies should be surface or adiabatic.

Default

True

--no-intersect, -i, --intersect

Flag to note whether the segments of the Room2Ds should be intersected with one another before the adjacencies are solved.

Default

True

--resolve-window-conflicts, -w, --show-window-conflicts

Flag to note whether conflicts between window parameters of adjacent segments should be resolved during adjacency setting or an error should be raised about the mismatch. Resolving conflicts will default to the window parameters with the larger are and assign them to the other segment.

Default

True

-f, --output-file <output_file>

Optional file to output the Model JSON string with solved adjacency. By default it will be printed out to stdout

Arguments

MODEL_FILE

Required argument

windows-by-ratio

Add windows to all outdoor walls of a model given a ratio.

Note that this method removes any existing WindowParameters.

Args:
model_file: Full path to a Dragonfly DFJSON or DFpkl file.
ratio: A number between 0 and 1 (but not perfectly equal to 1) for the
desired ratio between window area and wall area. If multiple values
are input here, different WindowParameters will be assigned based on
cardinal direction, starting with north and moving clockwise.
dragonfly edit windows-by-ratio [OPTIONS] MODEL_FILE [RATIO]...

Options

-f, --output-file <output_file>

Optional file to output the Model JSON string with windows. By default it will be printed out to stdout

Arguments

MODEL_FILE

Required argument

RATIO

Optional argument(s)