excel rhino workflow via the web flux · pdf fileparameters. vice versa, any changes made...

26
ExcelRhino Workflow via the Web FLUX Version 1.0

Upload: ngominh

Post on 06-Mar-2018

219 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Excel↔Rhino Workflow via the Web

FLUX Version 1.0

Page 2: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

TABLE OF CONTENTS

1.0 INTRODUCTION

1.1 WHY FLUX 1.2 OVERVIEW OF THE PRIMER 1.3 SOFTWARE REQUIREMENTS 1.4 BASIC PREREQUISITE KNOWLEDGE

2.0 TRANSFERRING DATA THROUGH FLUX 3.0 SENDING DATA FROM EXCEL TO RHINO

3.1 DOWNLOADING THE FLUX PLUGINS 3.2 SENDING DATA FROM EXCEL TO FLUX 3.3 RECEIVING DATA IN GRASSHOPPER FROM FLUX

4.0 SENDING DATA FROM RHINO TO EXCEL 4.1 SENDING DATA FROM RHINO TO FLUX 4.2 RECEIVING DATA IN EXCEL FROM FLUX

5.0 APPENDIX 5.1 INDEX 5.2 BUILDING A TWISTY TOWER IN GRASSHOPPER

2 last updated 3/23/2016

Page 3: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

1.0 INTRODUCTION 1.1 WHY FLUX

Excel is often used during the design of a building project to define parameters and store relevant data, but harnessing that data directly from Rhino is a common design challenge. Many tools have been developed over time to address this need. For example, popular Grasshopper plugins like gHowl and TT Toolbox have built-in functionality for reading from or writing to Excel. Many people also choose to manually export and import .csv files. Unfortunately, these methods are all file-based and do not allow for the reading or writing of isolated values and tables to or from an Excel document. Exchanging information between the Excel and Rhino files requires both files to be hosted on the same computer. Additionally, many of these methods do not create live links. Updates to parameters hosted in Excel, for example, must be manually synchronized with the Rhino model by a designer. This method is error-prone and slows down design iteration. Finally, two designers referring to the same data must save it in a mutually accessible place or risk using outdated data. All of these setbacks create friction against collaboration. As the demands for building design increase in a rapidly urbanizing world, each of these drawbacks create inefficiencies that only compound as design complexity grows. Flux provides a unique solution for connecting Excel and Rhino via the web. Rather than exporting, importing or converting files locally, Flux enables the transfer of data directly from one application to the other via the web. As a result, a reliable live link is created so that any changes made to Flux-enabled parameters in Excel can immediately propagate to a Rhino model using those parameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet. The ability to keep designs precisely and automatically in sync speeds up each iteration cycle and ensures that collaborators on a project are always using the most up to date design parameters.

1.2 OVERVIEW OF THE PRIMER This primer will walk you through the basic steps for creating an Excel to Rhino workflow and a Rhino to Excel workflow with the Flux plugins for Excel and Grasshopper. By the end of this primer, you will be able to:

• leverage the Flux Excel and Grasshopper plugins to drive a parametric model within Rhino using parameters hosted in Excel

• leverage the same plugins to display extracted information from the Rhino model in Excel • create a basic Excel user interface for sending and receiving changes to and from a model in

Rhino

1.3 SOFTWARE REQUIREMENTS • latest Chrome browser (download link) • Rhino 5 SR9+ 64-bit for Windows (download link)

3 last updated 3/23/2016

Page 4: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

• Grasshopper 0.9+ (download link) • Microsoft Excel 32 or 64-bit, 2010, 2013, 2015 or 2016 (download link) • Flux account (sign up at flux.io/signup using the latest Chrome browser) • Flux Excel plugin and Flux Grasshopper plugin (download link)

1.4 BASIC PREREQUISITE KNOWLEDGE • Excel • Rhino & Grasshopper

4 last updated 3/23/2016

Page 5: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

2.0 TRANSFERRING DATA THROUGH FLUX Before jumping into the how-to section of this document, let’s quickly review what we are going to do. Here is a diagram for how your Excel parameters will used to build your Rhino model:

The first half of the diagram shows what you will do in Section 3.2 Connecting Excel to Flux. Using the Excel plugin, you will send parameters (represented by the blue piece) to the Flux cloud. It will thereafter be stored in the cloud along with all other data that you send to Flux. The second half of this diagram shows what you will do in Section 3.3 Connecting Grasshopper to Flux. You will be using the Grasshopper plugin to receive the same parameters from Flux into the Grasshopper environment, so they can be used in your design. Now that you have an overview of the process, let’s get started.

5 last updated 3/23/2016

Page 6: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

3.0 SENDING DATA FROM EXCEL TO RHINO This section will cover how to create an Excel to Rhino workflow. For the purpose of clarity, this how-to guide uses a Twisty Tower model to demonstrate the Excel to Rhino workflow. A tutorial for the Twisty Tower is included in Section 5.2 Building a Twisty Tower in Grasshopper. You can use the Twisty Tower or your own Grasshopper model as a starting point for this primer. An animated example of the complete workflow can be found here.

3.1 DOWNLOADING THE FLUX PLUGINS To setup up your Flux workspace within Grasshopper and Dynamo, download the Flux plugins using the combined installer. Once you relaunch both applications, you will notice a Flux toolbar has appeared alongside the other native toolbars. For a detailed description of the Flux Excel toolbar and how to use it, refer to Section 5.1.1 Flux Excel Toolbar. Similarly, for a detailed description of the Flux Grasshopper components and how to use them, refer to Section 5.1.2 Flux Grasshopper Components.

3.2 SENDING DATA FROM EXCEL TO FLUX In this section, we will define the parameters of the Twisty Tower in Excel and send them to Flux. The image below shows the completed workflow for this section:

3.2.1 CREATING OR SELECTING A FLUX PROJECT

6 last updated 3/23/2016

Page 7: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Click the Log In button to log into your Flux account. Check “Remember me on this computer” to skip this dialogue box in the future.

Click on the Projects button to view projects that you’ve already created in Flux. Select “New project…” at the top of the list to create a new project. Alternatively, if you have already created a project that you’d like to use, you can select it.

If you choose to create a new project, a dialogue box will prompt you to “Enter project name”. Type in your desired project name and press “OK”.

The project should now be selected in the toolbar.

3.2.2 CREATING OR SELECTING A DATAKEY

Click on the Keys button to view the keys that you’ve already created in the selected project. Since “My New Twisty Tower” was just created, it will not have any keys. Select “New key…” to create a new key. Alternatively, if you are using an existing project with available keys, select the key you’d like to use.

7 last updated 3/23/2016

Page 8: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

The Twisty Tower shown in Section 5.2 Building a Twisty Tower in Grasshopper has five different controlling parameters: tower height, floor height, floor radius, floor sides, and tower rotation. Give your data keys descriptive names for the data they contain. Let’s name our first data key “tower height”. Click “OK”.

You will now be prompted to give your data key a description. When you’re done typing, click “OK”.

The key should now be selected in the toolbar.

To add a value to your data key, type the number you’d like for your tower height within the Excel spreadsheet. Leave a cell above for the data key’s name. Note: this example only shows one number being added to a data key, but it is also possible to add rows, columns, or tables of data to a data key. Proceed to Section 3.2.3 Setting the Flow Control.

3.2.3 SETTING THE FLOW CONTROL

Select Constantly mode in the Flux toolbar. Check Section 5.1.1 Flux Excel Toolbar to see the difference between Once and Constantly mode.

3.2.4 SENDING A VALUE TO FLUX

8 last updated 3/23/2016

Page 9: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Select the cell above the value you want to send to Flux.

Click on the To Flux formula. You will now be prompted by a dialogue box to select the range of data you’d like to push. Highlight the cell with the desired value for the data key and click “OK”.

The value will now be labeled with the name of data key. This confirms that you have sent this value to Flux.

Repeat the steps for creating keys and sending them to Flux for all the other parameters of the Twisty Tower.

9 last updated 3/23/2016

Page 10: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

3.3 RECEIVING DATA IN GRASSHOPPER FROM FLUX We are now going to receive the parameters of the Twisty Tower from Flux into Grasshopper. The Twisty Tower tutorial in Section 5.2 Building a Twisty Tower in Grasshopper uses Number Slider input parameters to define the parameters of the tower. In this section, we are going to replace the Number Sliders with Flux components that receive the parameters defined in Excel. The image below shows the completed workflow for this section:

3.2.1 SELECTING A FLUX PROJECT

Click and drag the Flux Projects component onto your Grasshopper canvas. If you checked “Remember me on this computer” when logging into the Excel Flux plugin, you should not be prompted to log in again.

10 last updated 3/23/2016

Page 11: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Click on the Flux Projects component tab to view projects that you’ve already created in Flux. Type in the name of the project you created in Excel and select it from the list.

Once you’ve selected the project, the component will display its name.

3.2.2 SELECTING A FLUX KEY

Drag the From Flux component onto the canvas and connect the Keys (Ks) output from

the Flux Project component to the Keys (Ks)

input of the From Flux component.

Click on the From Flux component to view the keys that already exist in this project. Select the tower height data key that you created in Excel.

11 last updated 3/23/2016

Page 12: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Once you’ve selected the key, the component will display its name.

3.2.3 SETTING THE FLOW CONTROL

Drag the Flow Control component onto the canvas and wire its output to the Mode (M) input

of the From Flux component. Select Constantly mode.

3.2.4 RECEIVING A PARAMETER FROM FLUX

To check if Grasshopper has successfully received the tower height parameter from Excel, wire the

Value (V) output of the From Flux component to the rest of the Twisty Tower definition as shown below, replacing the buildingHeight Number Slider.

12 last updated 3/23/2016

Page 13: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Now try changing the value of the tower height parameter in Excel; it should automatically change the height of the Twisty Tower in Rhino when Constantly mode is selected for the Flow Control in Excel and Grasshopper. Repeat the steps for receiving the parameters from Excel into Grasshopper. You can reuse the Flux

Projects and Flow Control components for each parameter, as shown below. Replace each Number slider with the appropriate Flux components.

You now have a complete Excel to Rhino workflow! Make changes to your Excel parameters to see your Twisty Tower automatically update while the Flow Control for both applications is set to Constantly.

13 last updated 3/23/2016

Page 14: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

4.0 SENDING DATA FROM RHINO TO EXCEL This section will extend the Twisty Tower example from Section 3.0 Sending Data from Excel to Rhino to create a Rhino to Excel workflow. Following similar steps as the above, you will send the gross floor area of the tower from Grasshopper back to Excel.

4.1 SENDING DATA FROM RHINO TO FLUX You now have a Twisty Tower model in Rhino that is being driven by parameters in Excel. In this section, you will send back to Excel the gross floor area of the tower calculated within Grasshopper. The steps for calculating the floor area can be found in the last section of the Twisty Tower tutorial Section 5.2.4 Calculate the Total Floor Area. You could imagine a user unfamiliar with Grasshopper benefiting from this workflow. He or she can now operate the Grasshopper script from a familiar Excel interface and receive the necessary information he or she needs from the model. Because everything is parameterized, the floor area in Excel will respond to the changes he or she makes to the Twisty Tower parameters. The Grasshopper components for sending data to Flux are very similar to the components used for receiving data from Flux.

Use the Flux Projects component to select the “My New Twisty Tower” or the project name that you’ve been using for this tutorial. Refer to Section 3.2.1 Creating or Selecting a Flux Project for more detail.

Now use the To Flux component (instead of the

From Flux component) to create a new key called “total floor area”. Refer to Section 3.2.2 Creating or Selecting a Flux Key for more detail.

14 last updated 3/23/2016

Page 15: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Set the Flow Control to Constantly Mode. Refer to Section 3.2.3 Setting the Flow Control for more detail.

You can now send the total floor area of the tower to Flux by wiring the output of the Mass Addition component to the Value input of the To Flux component.

Here it is in the context of the rest of the Grasshopper definition:

4.2 RECEIVING DATA IN EXCEL FROM FLUX Now we can receive the value of the total floor area in Excel.

15 last updated 3/23/2016

Page 16: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Select the cell above the one that will hold the value from Flux.

Make sure you have the right project and key selected, and that the Flow Control is set to Constantly.

Click on the From Flux formula. The value of the total floor area of the Twisty Tower should now appear under your selected cell and now be labeled with the name of data key.

You now have a simple user interface within Excel to send/receive updates to/from your Rhino model. Make changes to your Excel parameters to see the total floor area of the Twisty Tower automatically update while the Flow Control for both Excel and Grasshopper are set to Constantly.

16 last updated 3/23/2016

Page 17: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

5.0 APPENDIX 5.1 INDEX

5.1.1 FLUX EXCEL TOOLBAR

The Flux Excel toolbar (shown above) has six main actions:

Log in

This button allows you to login to your Flux account. Once you are logged in, you will have direct access to your projects and keys and be able to send data from Excel to Flux.

Projects

This button gives you a dropdown menu of all your available Flux projects and allows you to create a new project.

Keys

This button gives you a dropdown menu all of the available keys within the selected Flux project and allows you to create a new key.

Flow

Control

The Flow Control modes set how frequently you send/receive data to/from Flux. ‘Once’ mode allows you to send/receive data to/from a Flux key manually when you choose. ‘Constantly’ mode allows you to send/receive data to/from a Flux key automatically every time a change is made. To make this more clear, check out the table below to understand how the Flow Control modes of the sender and receiver affect the frequency of data transfer.

Send Data to Flux Receive Data from Flux Frequency of Data Transfer

Constantly Constantly Instant data transfer between sender and receiver every time there is an update.

Constantly Once Latest data available to receiver when he/she chooses to receive it.

Once Constantly Latest data available to receiver when the sender chooses to

17 last updated 3/23/2016

Page 18: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

share it.

Once Once Data transfers only when the sender chooses to share it and the receiver chooses to receive it. Sender and receiver could potentially be out of sync.

To Flux

This formula allows you to send data from your Excel spreadsheet to the selected data key in Flux.

From Flux

This formula allows you to receive data into your Excel spreadsheet from the selected data key in Flux.

5.1.2 FLUX GRASSHOPPER COMPONENTS

There are four important Flux Grasshopper components within the Flux toolbar (shown above):

Flux Projects

This component allows you to select the Flux project that you’d like to send your model to. It has an optional Filter (F) input that filters down the project names within the component’s dropdown menu. It outputs the Keys (Ks) of the selected Flux project as a list and Metadata (M) of the project.

To Flux

This component allows you to send data to a Flux key within a Flux project. It requires two inputs: the Keys (Ks) output from the Flux Projects component, and your data for the Value (V) input. It also has a third recommended input called Mode (M), which receives the output of the Flow Control component.

From Flux

This component allows you to receive data from a Flux key within a Flux project. It has the same Keys (Ks) and Mode (M) inputs as the To Flux component. Therefore, the Value (V) referencing your data is an output instead of an input.

18 last updated 3/23/2016

Page 19: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Flow Control

This component sets how frequently you send/receive data and feeds into the Mode (M) input of the To Flux and From Flux components. The ‘Once’ and ‘Constantly’ modes mirror the behavior of the Excel Flow Control modes.

5.2 BUILDING A TWISTY TOWER IN GRASSHOPPER This section is an abridged version of the following tutorial found online: http://wiki.bk.tudelft.nl/toi-pedia/Tutorial_1_-_Rotating_Tower

5.2.1 DEFINE THE INPUTS

For this particular tower, there are five different controlling parameters: • the height of the tower • the height of each floor • the radius of each floor • the number of edges of each floor • the rotation of the tower

Here is a diagram for how each of these inputs will determine the final structure of the tower:

5.2.2 DEFINE THE HEIGHT OF THE TOWER

We define the height of the tower by drawing a vertical line that will as the spine of the building. We do this by connecting two points along the z-axis with the following blocks (names in red):

• 2 x Vector >> Point >> Point XYZ

19 last updated 3/23/2016

Page 20: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

• Params >> Input >> Number Slider • Curve >> Primitive >> Line

Pull them onto the Grasshopper canvas and connect them as shown below:

Right-hand click on the Number Slider and click Edit to change its Properties:

• Name: buildingHeight (it’s good practice to name parameters) • Min: 3.00 (the minimum height of the tower is 3 meters) • Max: 300.00 • Numeric value: 100.00

Your Rhino model should now look like this:

20 last updated 3/23/2016

Page 21: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

5.2.3 OUTLINE THE FLOORS

We now want to set the floor height and divide the spine of the building based on this height. To do this, we will use two blocks:

• Curve >> Division >> Divide Distance • Params >> Input >> Number Slider

Again, edit the Parameters of the Number Slider:

• Name: floorHeight • Min: 2.80 • Max: 6.00

Now we create the shape of the floor with a simple polygon. The polygon block has four inputs, but we will only focus on two: its radius and number of sides. These two inputs will be defined once again by Number Sliders.

• 2 x Curve >> Primitive >> Polygon • 2 x Params >> Input >> Number Slider

Parameters for Number Slider A:

• Name: outerRadius • Min: 5.00 • Max: 25.00

Parameters for Number Slider B:

• Name: numberOfSides • Min: 3 • Max: 10 • Numeric Value: 6

For Number Slider B, you should also right-hand click on the component and change slider type to Integers. That way you won’t have a fraction of sides for a polygon. Wire everything up to set the polygons as the bottom and top of the tower:

21 last updated 3/23/2016

Page 22: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

5.2.4 ADD ROTATION

Before we create the rest of the floors, let’s add rotation to the tower. • Transform >> Euclidean >> Rotate • Math >> Script >> Evaluate • Params >> Input >> Number Slider

Parameters for the Number Slider:

• Name: Rotation • Min: 0.00 • Max: 180.00

Notice that the Rotate component has an input called Angle. This is the angle of the rotation in radians. Because the Number Slider is feeding the value of the rotation in degrees, we need to use the Evaluate component to convert the degrees into radians. Right-hand click on the F input for the Evaluate component and type Rad(x) under Expression Editor. The component will now convert degrees into radians.

22 last updated 3/23/2016

Page 23: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

Wire up the components to the polygon on the top of the building.

The Rotate component actually duplicates the polygon that is fed into its inputs. Right-hand click on the Polygon component and toggle the Preview button off; the duplicate will disappear. Now we can create the outer surface of the tower with one more block:

• Surface >> Freeform >> Loft

23 last updated 3/23/2016

Page 24: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

To connect both Polygon components to the Loft component, wire up one and then hold the Shift key when wiring up the other. Once you complete this step, have some fun toggling the buildingHeight, outerRadius, numberOfSides, and Rotation to see the effect.

5.2.5 CREATE THE FLOORS

Now we return back to creating the floors using the points along the spine of the building as our guide. We need to first create planes using the points as the center points.

• Vector >> Plane >> XY Plane • Intersect >> Mathematical >> Brep_Plane

The XY Plane component will create a plane at every point as described. The Brep_Plane component will trace the intersection of each plane and the outer edge of the tower created by the Loft component. To see this awesome effect in action, toggle the Preview of the Loft component off, as well, as the XY Plane component once you’ve wired it up.

24 last updated 3/23/2016

Page 25: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

You can reorganize your Grasshopper components into groups and use the component Scribble to label the different sections. This is good practice in general but will also be particularly useful for the Excel to Rhino workflow described in this primer under Section 3.0 Sending Data from Excel to Rhino.

5.2.6 CALCULATE THE TOTAL FLOOR AREA

Finally, as an additional step to this example, calculate the total floor area for the Twisty Tower. This will become relevant for the Rhino to Excel workflow described in this primer under Section 4.0 Sending Data from Rhino to Excel.

• Surface >> Analysis >> Area • Sets >> Tree >> Flatten

25 last updated 3/23/2016

Page 26: Excel Rhino Workflow via the Web FLUX · PDF fileparameters. Vice versa, any changes made within a Flux-enabled Rhino model can propagate to the same or another Excel spreadsheet

• Maths >> Operators >> Mass Addition Wire the Curves output of the Brep_Plane component to the Geometry input of the Area component. This will generate a nested list of the areas for each floor. In order to add them together for the total floor area of the tower, the Flatten component must first be used to convert the nested list into a list with no nesting. You can use two Panels to check how the Flatten component works.

Finally, use the Mass Addition component to add up the list of floor areas. The result is quoted in meters squared.

26 last updated 3/23/2016