[cea-s-01] From Grasshopper to CEA Dashboard
Want to simulate your design in Grasshopper for its energy performance using CEA? This lesson introduces a method to export designs in Grasshopper to CEA-executable format.
This CEA Lesson is under the Sensitivity Analysis Module required by the Designer Track and is Optional for the Engineer Track.
I am personally very excited to release this CEA Lesson as it marks the CEA Team’s new endeavour to re-introduce CEA’s UI@Grasshopper.
In this CEA Lesson, I am introducing a method to export your design into a format that is executable by the CEA Dashboard using the existing landscape of libraries@Rhino/Grasshopper.
Follow-next-steps
Now, follow closely the steps listed below to prepare the two minimum CEA inputs (i.e. zone.shp and typology.dbf) to get any CEA simulations started. I will explain why we are doing so by the end of each step.
Step 1. Create a Scenario
Launch CEA Dashboard;
Then, create a new Scenario by drawing to circle in your study area with the CEA Zone helper;
Now, we can find the zone.shp for this newly created Scenario under Folder {your project}/{this new scenario}/inputs/building-geometry.
This step facilitates us to acquire a base map where we place our design in Grasshopper (Step 2). Geometries in Rhino is not geo-referenced. However, we can use a “trick“ to find the “correct geo-location” of our design by considering the canvas of Rhino as a substitute of the projected plane of the base map. (I guess you might still be confused at this point. No worries, let’s continue to the next step first.)
Step 2. Spot the “correct geo-location” on Rhino’s Viewports
Navigate to Tab Utilites > SHP to CSV to SHP;
Link the zone.shp produced in Step 1 under input-file on CEA Dashboard (Fig.cea-s-01-01);
Set the output-file-name as zone.xlsx (can be any name but only extensions .csv or .xlsx) on CEA Dashboard (Fig.cea-s-01-01);
Type in the path to store the output under output-path on CEA Dashboard (Fig.cea-s-01-01);
Link the the same zone.shp produced in Step 1 under reference-shapefile on CEA Dashboard (Fig.cea-s-01-01);
Set polygon to True on CEA Dashboard (Fig.cea-s-01-01);
Click on Run Script;
Now, we have the building footprints in the zone.shp stored in the format of [[463721.7362, 15245947.2], [463722.7364, 15245954.04], [463739.366, 15245953.25], [463721.7362, 15245947.2]] under Column [“geometry”] under zone.xlsx (Fig.cea-s-01-02);
Launch Rhino8/Grasshopper, and construct the vertices of the building footprints using the coordinates above;
Now, we have the base map at the “correct geo-location”.
This step allows us have our design readily place at the correct place in Grasshopper.
Step 3. Export the design
Construct a GH script to export the geometries into zone.csv or zone.xlsx (soonish, I will include a downloadable GH script here);
Pay attention to the delimiters when using .csv format and they should be commas;
The table should look like as illlustrated in Fig.cea-s-01-02;
Pay attention to the column names of the table as they should be case-sensitive;
The building footprint geometrical information is stored in Column [“geometry”]: for a triangle-shaped building footprint as an example, it should look like “[[463721.7362, 15245947.2], [463722.7364, 15245954.04], [463739.366, 15245953.25], [463721.7362, 15245947.2]] with the the coordinate of the first vertice repeated at the end", and the unit of the coordinates is in metres;
Create a file named typology.csv or typology.xlsx storing the information of the other minimum input for CEA as illustrated in Fig.cea-s-01-03;
Make sure the information of the two tables are matching by the Column [“Name”];
Now, we have both the information of the two minimum CEA inputs prepared in CEA-executable format.
This step prepares the minimum inputs to get the CEA simulations started in an executable-format for CEA Dashboard.
Step 4. Prepare CEA-format inputs
Launch CEA Dashboard and navigate to Tab Utilites > DBF to CSV to DBF;
Link the file named typology.xlsx or typology.csv (Step 3) under input-file on CEA Dashboard (Fig.cea-s-01-04);
Type in the path to store the output under output-path on CEA Dashboard (Fig.cea-s-01-04);
Set the output-file-name as typology.dbf on CEA Dashboard (Fig.cea-s-01-04);
Click on Run Script;
Now, we have one of the two minmum CEA inputs ready as typology.dbf;
Navigate to Tab Utilites > SHP to CSV to SHP;
Link the file named zone.xlsx or zone.csv (Step 3) under input-file on CEA Dashboard (Fig.cea-s-01-05);
Set the output-file-name as zone.shp on CEA Dashboard (Fig.cea-s-01-05);
Type in the path to store the output under output-path on CEA Dashboard (Fig.cea-s-01-05);
Link the original zone.shp (Step 1) under reference-shapefile on CEA Dashboard (Fig.cea-s-01-05);
Set polygon to True on CEA Dashboard (Fig.cea-s-01-05);
Click on Run Script;
Now, we have the other minmum CEA inputs ready as zone.shp;
Create a folder named a new scenario under the current CEA Project folder;
Make sure we store the zone.shp (Step 4) under Folder {your project}/{a new scenario}/inputs/building-geometry;
Make sure we store the typology.dbf (Step 4) under Folder {your project}/{a new scenario}/inputs/building-properties;
Now, we the minimum CEA inputs readily stored under the correct CEA directory.
This step converts the Grasshopper-exported files into the CEA format and stores them at the correct location under a new scenario.
Step 5. Execute CEA simulations to assess the energy performance of our design
Navigate to Tab Utilites > Database initializer;
Select or link to any self-defined database under databases-path on CEA Dashboard (Fig.cea-s-01-06);
Click on Run Script;
Go through the CEA Toolboxes of Data Management, Demand Forecasting, etc. (click here for the CEA Maps).
What-is-next?
Now, we can execute CEA simulations to assess our design in Grasshopper for its energy performance. In the following CEA Lessons under this Sensitivity Analysis Module, I will introduce how to assess hundreds of designs genereated using Grasshopper and batch process CEA simulations over these designs.
Questions?
Encountering difficulties or having questions above the processed above? Proceed to the CEA Forum to post your questions. Your questions may be universal and can benefit other CEA users. Please include the Lesson Code [cea-s-01] when posting your question.