Import From Excel into Dynamo
To Import data from Excel you can use the out-of-the-box Import node in Dynamo.
For Dynamo version 2.x, search "excel" in the search bar and find the node [ImportExcel].
For Dynamo version 1.x, search for "excel" and find the node [ReadFromFile].
To simplify this post, we will only focus on the Dynamo 2.x version of the node and that should cover the Dynamo 1.x version as well.
The [ImportExcel] node has 4 inputs.
- "file"
This is your Excel file. Note that there are two nodes required for this input to work:
a. [File Path]
b. [File From Path] - "sheetName"
This is the name of the sheet in Excel (also called tab or sheet tab) where your data is stored. The input format needs to be a String. Either use a [String] node or the [Code Block] node. See article on how to use quotations to input strings into a [Code Block]. - "readAsStrings"
This input asks a question, "Do you want to convert all the data in the Excel sheet as a string regardless of the format of the cell?" Sometimes this is required in order for a script to work, though most of the time this can be left as "false". If you don't attach anything to this input, the default value is "false". You can turn this function on by attaching a use a [Boolean] node to change this to "true" if needed. It's recommended to switch this to "true" so that all your data is consistently read as text. Once it's in Dynamo you can convert the text into numbers if necessary. Use a [Boolean] node to switch to "true". - "showExcel"
This input simply means after running the script, the Excel file will open so long as the file path is correct in step 1. By default, this setting is set to show ("true") the Excel file. You can turn this off by attaching a [Boolean] node set to "false". It is recommended to leave this as "true" because when the script it run it will conveniently open the previously set Excel file for you. This can help you find the Excel file if you forgot where you saved it or which version you were using.
The setup looks like this.
Dynamo will read all cells with data in the Excel file and provide the results in a list format. Read more about how to organize and target specific rows and columns of data in an article coming soon.
Download the script to see how the [ImportExcel] node should be set up.
*Clicking this link will bring you to the download page.
Note that the [Data.ImportExcel] node can only read one Excel sheet with at a time. Download the files below to see how you read multiple Excel sheets in one Excel file.
*Clicking this link will bring you to the download page.
Saved in Dynamo Version:
2.x.
Dynamo Packages Required:
None.
References:
None.
3 Comments
martin rodriguez · December 22, 2020 at 5:04 am
how does this info display in a revit view
does one have to create a dummy schedule
Martin Rodriguerz · December 22, 2020 at 6:46 am
how to then display this info in a revit view (assume not using schedule)
ElevateBIM · December 2, 2021 at 12:19 am
The typical method would be to use a Revit schedule. Set up your schedule to view the element categories you are working on and all the parameters associated with those categories.