How to assign color based on value import from Excel through Dynamo workflow to Revit model

Hi there for anyone who is reading this topic. Really appricate for spending time on this with me.

I am a university student who is working on a final year project for sensor data and BIM linkage. The approach I planned is to make use of Excel live link function for the sensor data recording and using Dynamo to connect Revit model. The meaning of connecting Revit model is to make the data gatherred from Excel to be visualized (i.e. highlighting illuminance in color according to the readings of sensor) in the model. However, I have encountered difficuilities for the visualization part after having setup of Dynamo workflow for the importing Excel data to dynamo, the workflow setup is attached below. May I ask for assistance for the following workflow parts for the visualization. Thank you.

  1. Zoom in more on the screenshot, the name of the nodes is not visible in this zoom level.
  2. Yes, you can ask for assistance, that’s the purpose of this forum. What is your question? It seems to me data is nicely imported to Dynamo, well done.
  3. You posted this to wrong category, challenge category is not for this kind of posts

Thx for the reply. Sorry for the issue 1 and 3. For the issue 3, I will re-post soon without the challenge category.

For the screenshot stated in issue 1, I took a new on and it is as follow,

The main assistance I would like to ask is focusing on converting the improted data from excel and display it in Revit model (i.e. on a surface of a model elements) with set parameters, say having X lux illuminance will have a colored surface displaying on it.

P.s. please continue the discussion referring to the latest post without the challenge category

I think you have 4 options:

  1. Revit has a specific functionality and API for similar use case, called AnalysisDisplay. With this API you can display overlays over your model, Revit will automatically create color ranges, legends for you. There are some nodes about this in Dynamo for the basic usage, under Revit->Analysis. If you want to dive deeper, here is the related API docs:

This display is like an overlay, you cannot modify data from Revit, but the data saved in the file, so it will be displayed if you just send the file to someone else. The data can be displayed in 3D and 2D, but this overlay is a 3D element, so other model elements can obscure it.

The official help is not very detailed about this topic, and you won’t find a lot of forum posts about this, so if you go this route expect some trial and error:

  1. Filters. Assign the sensor data to a parameter of an element, and create/update filters with Dynamo, according to values. Be careful, on sensor update you will have to update the filter rules, not just the parameter values, as you can’t apply a color range to a filter. The plus of this it’s fully transparent, so the data is accessible for everything, as it’s just a parameter value. You can schedule it, tag it, etc…

  2. Material manipulations. You cannot override materials by element, so for each sensors you need a separate material assigned to different elements, and change the parameters of the materials. Dynamo has some nodes for managing this. With this way you only have to update material properties on sensor updates. You can combine this workflow with the previous, so not just change the material but change the value of a parameter as well.

  3. Room/space color fills. If you only have one sensor per room it can work. If you know the expected values of the sensors, you can just set up colors manually, than just update a parameter of the room. Downside of this workflow, that it’s only working on plan views, no 3D.

    You can also set up color fills automatically, support for them were added recently in the API, added in Revit 2022. I cannot see any related nodes for this in Dynamo, so you have to use Python or C# for this:

This came to my mind first, it depends how you want to display the data, and how much you want to go down in the API. Good luck, this seems like a nice project.

I’m not quite sure how you want your final results to look. If you can map your values to Revit elements, then overriding the graphical properties according to your values should work (i.e. each element will have one color). If you want to go down that route I can help you with that.

It will be definitely a great help for me.

The expected final result myself would like to see is to show the value I got from Excel (the sensor data) in from of color on elements surface in Revit model. Please accpet my apologize that I am not sure on the function of mapping since I am quite new to Dynamo, so I am not sure whether it is similar to your expected outcome. Also, there are some areas I would like to ask and confirm as well.

Q1: Since the value will be changing for everytime I run the workflow due to the updates of sensor reading, is it possible to set range for the color so that the color display on surface will change accordingly?

Q2: As you can see there are mainly 4 groups of readings (excluding time), is it possible to apply different color display towards each of these readings and show them all in the Revit model?

Anyway, really thanks for the reply.

What I meant by mapping is that you create an instance parameter for your elements, so that you can store your imported values there (which is strictly speaking not necessary for the visualization). What does each data point mean currently? Does each one correspond to an element?
Q1: You can just set new overrides, each time you update - so yes, this should be possible.
Q2: If you want to show them all at once, then no, not with graphical overrides. You could create 4 views, each for a different group.

Thanks for the reply.

I would like to confirm what do you referring to for the data point. Does it mean the readings of UV, temperature, RH and illuminace as shown in the Dynamo workflow back to the beginning of the discussion? I would like to input these value with usage of the Ceiling category - New family “Air” for creation of surface to serve the function for showing and be visualizing in the model. Also, for Q2, I wonder if I could create 4 “Air” ceiling for coperating with different graphical overrides for groups of data to become a sort of solution as well.

For the future. No need to do this.
Moderators and some members can fix / change categories (if needed).

If I understand correctly, the data you have in your workflow would correspond to one “air” element, and the separate values are for each time step? It would probably be best if you could show which element should visualize your data.
The two things you need to do is create a color range for you data and then override the graphic settings using that color. Here is an example:

Thanks the reply once again.

The element I planned to visualize the sensor data is shown in the screen capture below, the selcted elements highlited. As mentioned, I am thinking if I create 4 same “air” ceilings with different levels so that I should be able to visualize each color of the data set, right? The existing challenge I am facing is how to make my data from excel to be visualized in the model, say overriding on the surface of the “air”, with the range of color and override as simliar as your example of workflows. Also another thing I am a bit confused on is how to connect the ports for each sensor data with “item” to the the color overriding workflow since I really don’t know how.

I guess it would be easiest if you create a parameter for ceilings (e.g. the sensor ID/name/…) and then export a list of element IDs + your parameter. Then you should be able to prepare your data in excel, so that you can override each element selected by ID.

Is it like the following screenshots of properties that I have just adjusted in the Revit model?

If it is the case, I would like to know about how to setup a workflow that is similar with your example with the range of colour changing according to the imported data from excel as well.

Again, really apprecaite for the active response!

I suggest you try to build the dynamo script for one element only at first. For that, you can just use a node that allows you to pick the element within the Revit model. Use that as an input for Element.OverrideInView and see if you can get the color range to work. For testing, you can just use a number slider as your sensor data input, so you don’t have to worry about reading your data for now. Once that works, you can expand the script.

Thanks for everyone who provide me direction for this topic! I have finally created a complete workflow for my study. Really thanks for the assist provied!!!

1 Like

Hello to everyone. I have a small problem with the parameter name in Dynamo. My project is quite similar to yours. Could you help me out, I am not quite sure what to put as the parameter name.

What are you trying to do? If you don’t know what parameter you should be supplying then you probably don’t understand what the graph is doing. What do those excel values represent? That should tell you which data device parameter corresponds with those values.

Please accept my apologies if I misunderstand your meaning just in case.

I believe there should be a desinated location or say, Revit elements parameter, you want the data to insert in the model right? Take mine as an example below, I would like to insert the designated data of Lux from the Excel to the designated Revit BIM element’s Lux parameter which I have created in the Revit, so for the “Code Block” node here, “Lux” is inserted where the Excel data will be inserted in the parameter accordingly that can do the whole thing. See if it would help you understand what your want to insert or not?

Also, I suggest you better open a new discussion within this forum as others apart from people who assisted me in this section can get in touch with you to assist you as well, while you can state more clear and in detail within your section based on your existing situation.

1 Like

Thank You so much to everyone who helped me. I managed to accomplish my goal and am grateful for the help I received from everyone.

1 Like