Skip to contents

write_model_generated() exports a building model structure to a YAML file and, if available, its associated furniture to a CSV file.

Usage

write_model_generated(output_path, model, furniture)

Arguments

output_path

character(1), directory path where building.yaml and furniture.csv will be written.

model

list, a building model object (generated by generate_model()) containing a structure element, or the raw structure itself. May also contain a furniture element.

furniture

data.frame, optional furniture description. If missing, the function attempts to extract it from model[["furniture"]].

Value

No return value, called for side effects (writing files to disk).

Details

The function extracts the structural component from model (checking for a $structure entry first) and serializes it to building.yaml via yaml::write_yaml().

If a furniture table is supplied directly or found inside model, it is exported to furniture.csv using utils::write.csv() with row.names = FALSE and quote = FALSE. If neither is present, no CSV file is created.