Color Revit surface via gradient

Hi guys,
I am trying to color a revit object that is shapped like a nike “swoosh” with one continuous color gradient. I am trying to do this by following the dynamo dictionary but am coming up waaaay short. First of all, can anyone tell me what the “indices” input does in plain english? I dont understand even with the extended definition in the dynamo dictionary. I cant get this input to make a bit of difference even when I try. Then, what does the “value” input do? Still dont get it… Finally I imported one of the surfaces that I want to color but its only getting one color. Why? Then how do I get this color assigned back onto the actual revit object from Dynamo? If I could get that far, Id be extatic, but then the million dollar question would be how do I color a 3D object in Revit a gradient? Here is what i got so far:

For your first questions:
The first input you provide to the color range node is a list of colors.
The second input “indices” means assigning an index to each of the colors between 0 to 1. If you view the color range, think of it as if the color range goes from 0 to 1. Now how should the colors in the first list be placed in this range from 0 to 1? Well, by assigning indices. So in the second input you assign where the different colors should be placed. In the below picture you can see that I’ve changed the indices to differentiate where the different colors should be.
Now the last input is where you specify which “color indices” you want to extract output. It should also be a value or list ranging from 0 to 1.

So the color range node doesn’t provide you with a color range as output, only a color range to extract colors from, sort of speak…Not sure if this is in more plain english than the dictionary, unfortunately, but just play around with it.

For your main question, the Element.OverrideColorInView node can’t help you with creating a gradient in Revit unfortunately, and the only solution I can think of right now is using the FaceAnalysis nodes in Dynamo. Then you will have to do some sort of analysis of your surface, let’s say the Y-value of some of the surface points.

Then apply an Analysis Display style in your view:

And you’ll get something in the vicinity of what you want, maybe.

Anyways, more of a workaround I guess…

5 Likes

@jostein_olsen
That was a fantastic explaination. There are only a couple things I dont understand. Can you explain the “value” input of the color range in a different way. I still dont see what its doing…? Then, on the FaceAnalysis node why did you put in “null” for unitType input? Then, when you assign the New Analysis display, how did you tell it to apply the colors you defined in dynamo? I dont see any association there?

Well I can try.
Picture yourself that the Color.Range node is an infinite list of colors. Instead of the regular indices that a list usually has going from 0,1,2,3,4,5 etc, this list have indices like 0, 0.0001,0.0002… all the way up to 1. For each of these indices the color changes incrementally through the colors you have specified.
Now, the value input works like a “List.GetValueAtIndex” node where you specify which index you want to extract from the list of colors. However since the color range isn’t indexed like normal lists (0,1,2,3,4,5) you must feed the input any value between 0 and 1, and the color range returns the color found at that particular index.

Clearer?

For the Unit type the only types available in Dynamo is the following:

and I probably could have used the length unit type, but I often use null because neither of them really describes the unit I’m using.

Lastly, there is no connection between dynamo color range and the colors of an analysis display. If you want to use analysis display you must set the colors in Revit itself.

2 Likes

@jostein_olsen, thanks! now I get it. So you cant color a surface in revit with a gradient at all? So what was all this about?:

You can’t color a surface in Revit with a gradient using the “traditional” graphical override node or other Dynamo nodes, except for creating a face analysis as per above. But it’s kind of a workaround wouldn’t you agree? :slight_smile:

1 Like

@jostein_olsen
Its not a workaround if it doesnt do any actual coloring. Thats what i dont understand. Are you using this graph to do the coloring in revit or not? Like I dont see you making any colors in this graph and then seeing them in revit. I dont even understand what this graph is doing if not coloring. Splitting up the surface into UV points? What good is that without color? Anyways, I cant get your graph to work at all. here is what mine does:

@jostein_olsen,

Great work. Unfortunately @mix is your typical frustrated Revit user that attempts to “do” things without understand Revit limitations and/or inner workings. I personally think that you did a great job of demonstrating a viable workaround for something that is not possible in Revit. Yes, the Analysis Framework that you used here is a bit hard to grasp for the rookie Revit user, so I can see how @mix got this all mixed up. Anyways, great answer.

@mix,

Please learn some basics of Dynamo and or even Revit and how they are connected. The simple answer to your question should be, no you can’t color surfaces in Revit with gradients. @jostein_olsen was doing you a favor and introduced you to something that you would probably never used otherwise. It’s a fairly obscure part of Revit that doesn’t get much burn in daily use.

Ps. Be nice people. You get an answer say: Thank you!

Cheers!

4 Likes

@jostein_olsen
Im sorry if I sounded ungrateful, thus far your answers were outstanding. The only thing I dont understand is the face analysis. I dont see it doing anything at all. Therefore I dont know what you mean by “a work around” I dont see the connection that you see. In any event thank you for your help thus far. Its the best I have seen on this site.
@Konrad_K_Sobon
I am trying to learn the basics of Dynamo and that is why I am on this site. I did the dynamo primer and its exercises and have begun reading the dynamo dictionary, and I am experimenting to push my limits. However, stuff isnt always explained well on those sites or errors happen even when you do everything the same exact way on those sites, and I am forced to ask my questions here because I have no one else to learn from. I am new to Dynamo, yes, but I am far from a “rookie Revit user” as you assume. I have been using Revit full time for 8 years now, in fact.

Im not sure why you made that assumption, but that was the most insulting statement I have ever heard on this site. That hurt. I take great pride in my Revit skills, fyi. And I am a long way from a “typical frustrated Revit user that attempts to “do” things without understand Revit limitations and/or inner workings”.

Hence it is not very often that I get to learn about things in Revit that I don’t already know about, or read about at least once. Truth be told, I was excited to hear about this “new” feature, and its possibilities. Especially coloring using analysis frame work. Like most people that aren’t structural designers, I haven’t used the analysis display style before but do you really think “shoo-ing me away” with out answering me is the best strategy? I am sure there is a bunch of people on this site that would love to know how this feature works. @jostein_olsen said it works. But I just don’t see it yet, thats all.

I am always pushing the boundaries of what I know so therefore I ask a lot of questions, and yes get frustrated at times, (like we ALL do). But honestly, I wasn’t even frustrated here. I was just stating a fact. No emotion at all. Its not a “work around” if it doesn’t “work”. (at least I cant get it to work). Besides, I already told @jostein_olsen that he gave “fantastic explanation” In this same exact post.

I didn’t insult anyone. I didn’t call anyone names. I didnt even get upset. So I don’t see what the problem is…

There is still something that doesn’t make sense. And his analysis graph doesn’t work, at all, for me. Considering @jostein_olsen’s explanations thus far, I’m sure his next answer will be very enlightening, and actually answer my question. I look forward to it :slight_smile:

I would start by reading about the AVF here: http://help.autodesk.com/view/BUILDING_PERFORMANCE_ANALYSIS/ENU/?guid=GUID-D6B44EB9-35A9-4FE3-A735-B9BF1FE2DFC8

What @jostein_olsen is doing is a workaround because this framework was invented for visualizing analysis results. You are not doing any analysis in Revit. You are artificially producing analysis results so that they can be visualized in order to simulate surface coloring. You are basically doing it backwards, but that’s how you can throw some color on a surface and save it in a view.

@mix, i called you a rookie because unfortunately you are. The fact that you have been using Revit for a decade has nothing to do with your level of expertise. We are all rookies when placed in specific context. I am a rookie when placed next to Jeremy Tammik, and you are a rookie when standing next to people with even rudimentary programming skills and basic knowledge of Revit API. That’s just the way it is. No reason to get offended. Please read up on AVF, what it does and how it works. It might just answer all of the questions you had here.

2 Likes

I have always known what the analysis did, and understood how it worked. I just have never done it. And why do you assume that I didn’t read up on it as soon as @jostein_olsen mentioned it? The problem is there isnt enough information on there, or in the AKN, when it just doesnt actually work like they say it will.

I always new that “You are not doing any analysis in Revit. You are artificially producing analysis results so that they can be visualized in order to simulate surface coloring. You are basically doing it backwards, but that’s how you can throw some color on a surface and save it in a view.” That’s why you think I am dumb right? because you think I didnt understand that? Well I did, actually. Thats why this topic is so exciting. Do you really think I missed that? Because I am pretty sure I already said that. But what I am looking for is the “…how you can throw some color on a surface and save it in a view.”?? I dont see how. I didnt see it on the ADK, and nothing Ive tried in this post works either can you write a graph that does this and control the gradient in dynamo and show me? Please?

@Konrad_K_Sobon
I am not a rookie. You dont know the first thing about me and you are just making overreaching assumptions with out actually finding out any facts about me. You are wrong, again. In yet another assumption of yours about me. “you are a rookie when standing next to people with even rudimentary programming skills and basic knowledge of Revit API” because you are assuming I dont have rudimentary programming skills and basic knowledge of the Revit API. When, in fact I DO. But there is no way you would know that either, because you didnt ask. Why do you insist to keep making wild assumptions about me? Just STOP. You are the only one on this post that is out of line. I had a valid question, about a very interesting topic and you decided to jump in and insult me. I guess all I can do is hope that you wake up on the right side of the bed tomorrow. If you think you are so much better than everyone else and you can just insult them because you view us as “lesser than you” without even gathering a single fact. Then just stay in bed. I mean why even bother to post on here at all if you dont like talking to people that dont know exactly what you know about revit/dynamo?

You can think I am a rookie if you want, but Zach Kron would disagree with you.

Perhaps try reading these two posts. They are not exactly what you are looking for but should explain some basic concepts:


If you got some time it would probably help to break down each individual node that was used in that post. Most of them are posted to the Archi-lab.net package and you can peek under the hood to see the code. They do however overlap with nodes that Dynamo distributes OOTB and nodes that @jostein_olsen used. You can go to Dynamo’s github page for those.

All of the things that you are asking for here were already answered before. @jostein_olsen posted a great answer, and there isn’t much that can be added to it. He also went over and beyond to explain it. AVF is not the greatest tool in the world. Go read up on it, test it out and you will see how limited it is. I bet you won’t be really excited about it after working with it for a few hours. Again, Revit doesn’t allow for surface coloring with gradients via standard override methods. What else is there to say?

Ps. Rookie isn’t really an insult. I didn’t ask you to fetch me donuts and carry my laptop bag around for me. I am an asshole so i might do that later. :stuck_out_tongue:

1 Like

But we arent talking a bout a standard override method are we? We are talking about the anaylsis coloring affect. You can tell from his post, that its not the same coloring scheme, so therefore Dynamo didnt actually do anything in this color:
you both just said that you can do it. But how? “How” is my question. @jostein_olsen offered up a graph but it didnt work. Can you @Konrad_K_Sobon explain to me why my graph doesnt work? The theory behind it all is great but when the node doesnt work, what good is it?


@mix, you asked two questions:

  1. About the color range node and how to use it. He explained that.
  2. About coloring surfaces in Revit. He explained that using the AVF.

These two things are separate questions that you posted. @jostein_olsen didn’t use Color Range to drive the result colors. He set up the analysis results so that if you use the same range of colors in Revit then you will get the same results.

Now, if you have actually went ahead and read my posts about the AVF that i linked to last time, you would see that some of the nodes that i coded up a while ago actually have color inputs. Dynamo OOTB doesn’t expose Color Settings, not for the node @jostein_olsen used. That’s why I said, he answered both of your questions. [quote=“jostein_olsen, post:4, topic:9147”]
Lastly, there is no connection between dynamo color range and the colors of an analysis display. If you want to use analysis display you must set the colors in Revit itself.
[/quote]

“Lastly, there is no connection between dynamo color range and the colors of an analysis display. If you want to use analysis display you must set the colors in Revit itself.”
yeah, I get that, but I thought he was using the analysis node to do the:

artificially production of analysis results part that I dont get. I mean I set up the color display like he did in revit, thinking that the “analysis” part was done in dynamo, which then revit could read from that but its not reading anything in my revit, therefore my revit is not showing any of the colors that I assigned to the view, because it has nothing to read. All the online help from Autodesk said that the analysis is mostly done by addins and revit is just reading it. Thats what I thought dynamo was doing in this case (taking the place of the analysis addin) but revit isn’t displaying anything as if it had no results. I understand its a two step process.
Step 1. Dynamo does the heavy lifting of “analyzing” the surface.
Step 2. Revit displays results of “analysis” from dynamo, based on its own color scheme.
except that its not working.

Do your nodes do all this with the color to appear in revit? I haven’t had a chance to look at your websites yet because I am at work. But if they do, then you just started with that in your very first post, and we could’ve skipped all this nonsense.
Thanks

Wow, guys, let’s not make this thread more amusing than it already is in this very much civilized land of the Dynamo community! :slight_smile:

Change the lacing of your Surface.PointAtParameter and UV.ByCoordinates to cross lacing and the FaceAnalysis node will produce an analysis result and stores it in Revit in the view specified. Now, to show the actual results and colors inside Revit you need to create an analysis display style as per image above and go to the Color pane and set your colors there.

Rightfully as @Konrad_K_Sobon stated, I assumed you had two questions.
I’ll also provide you with a link to a blogpost about the subject, although for point analysis, not a face pr se, but same principle.


Now good luck in your endeavours! If you got anymore questions please PM me and we can sort it out, I think this thread have had enough words for one day! :wink:

5 Likes

Lacing! That was it my problem! Thank you @jostein_olsen for not being blind to my problem. A novice Dynamo user, making a simple dynamo related mistake, what are the chances? lol Yet another fantastic answer, thanks so much! The only other thing that I figured out that was missing from this post (for anyone hoping to do this same thing) is that the object your trying to color has to be a mass. But, yeah, LACING! hahaha!

1 Like