Room color by area comparison

Hi Adam,
Thanks for your reply.
I have the red parameter.

I have the my_scheme_text_string parameter.

I set my_scheme_text_string to red in all rooms.

I edited the color scheme and when I chose my_scheme_text_string, the red automatically filled in the first line. I did the other two lines with green and blue. Thus, all my rooms became red.

Yet, nothing happens when I run Dynamo.

Looks like you have not created the required area parameter or given values

I did create the parameter and put the data on each line. Maybe with the bad setup?

Read this :point_up_2: @msarqui.
You are feeding nulls.
Replace the statement in your Code Block
with my example.

@adam_bear1
Problem is the statement in his Code Block.

Also you need to have a value in the
Required Area Parameter @msarqui.

Thanks for your help bvs1982, but as I mentioned in the first post I don’t know anything about Dynamo. So I have no idea where to put your code. I don’t know where the statement is and how to reconnect everything.

The Required Area parameter is fed by the ‘‘Area comparasion’’ schedule, as you can see in the first post.

You use only one Code Block;
A[0] - A[1] < 0;
Replace that with;
A[0] - A[1] < 0 ? true : false;.
This is an (the) If Statement.

Also i would suggest reading through the :point_down:.

The code is now running (I think), but all my rooms are still red.

I asked for this code on this forum because I thought it would be something easy. However, I am now clearly realizing that, for my stupidity, this is rocket science, and I don’t know how to follow your advice.

Now we are getting somewhere.
Your Required Field Parameter still
has no value.
So you are testing a value to a no (empty) value
in the, now correct, Code Block.

Forget Dynamo for a moment. Dynamo is just a way to automate values. You need to understand your process first.

You’re very close here. Value ranges don’t allow for exact values (ex: x = 0) so you have to give a little tolerance. In my scheme the middle range is actual 0 - 0.001 with the values formatted to two digits therefore showing 0-0. It’s just a small workaround. The parameter should also be the parameter associated with the difference in areas - not a color you want to show. Your view will then color each room based on which range the parameter value falls under.

All your values for “Required Area” are empty. Therefore nothing meets your conditional. Using a string value is an option but I highly recommend just doing the math and writing the actual value to the parameter. The Color Scheme conditions will handle the logic there. It also means you can compare actual values in the schedule rather than a color.

@Nick_Boyts
I wonder if we now didn’t mix up two things
for @msarqui :see_no_evil:.

If he has the two Parameters filled in
and the Scheme set up correctly he doesn’t need
the if statement part at all no?

With a Required Area parameter and an Actual Area parameter already filled out, all that’s necessary is a Area Difference parameter. It’s the exact same situation as the calculated field and conditional formatting in the schedule. The only difference is that schedule formatting only allows one override and calculated fields are only available in the schedule (therefore can’t be used for view filters). The third parameter, Area Difference, is to replace the calculated field outside of the schedule. The Color Scheme just allows you to filter and assign color overrides to rooms based on the value of Area Difference. The additional benefit of leaving the value as a number is that you can schedule it against the automatic calculated field to see when model changes have left your value out of date.

@Nick_Boyts
My brain :brain: is a bit fried for the week
(was a long one for me) :see_no_evil:.
I only knew for a fact the statement
in his Code Block was wrong
(which people didn’t notice?).
I hope i didn’t add more confusion.

Ok. My parameter associated with the difference in areas is the Difference one, shown in the schedule of my first post.

It is a Calculated Value parameter that does not appear in the Edit Color Scheme drop-down menu. So I can not use it.

Is there another way to create it that I can put a formula and it will show in the drop-down menu?

This will return a true or false value based on if the item at the matching level of list A[0] being than the equivalent in A[1].

Pretty sure that each of these return the same sequence of booleans for the same nested list A:
A[1]>A[0];
A[0]<A[1];
A[0]-A[1] <0;
A[1]>A[0] ? true : false;
A[0]<A[1] ? true : false;
A[0]-A[1] <0 ? true : false;

2 Likes

Then stand me correct and i also learned a thing.
Also, as i said, my brain :brain: is fried for
this week :see_no_evil:.

The code block conditional was actually fine. You don’t need to specify the “if, else” part of a conditional returning a boolean. That’s already what the conditional is doing. The issue was the empty values from the second parameter.

1 Like

Correct. That’s why you need to create a new project parameter assigned to rooms that you can write a number to.

As i said; i stand corrected.
I now also learned something.
I guess i could (should) have tested that
before replying :see_no_evil:.

I was right on this then though :sweat_smile:.

1 Like

But how this new project parameter will get the values of the Calculated one to know when the area is lower, equal, or higher than the required ones?

That’s the Dynamo part. The calculated field can’t be used outside the schedule so you’re creating a project parameter that can hold the same information. It just has to be manually filled in. Using Dynamo however, you can automate the calculation and update the parameter value.