How to assign multiple choice of colors to a single element/geometry? - Revit Family Editor

How to assign multiple choice of colors to a single element/geometry? - Revit Family Editor

yara.cp.pereira
Enthusiast Enthusiast
1,121 Views
16 Replies
Message 1 of 17

How to assign multiple choice of colors to a single element/geometry? - Revit Family Editor

yara.cp.pereira
Enthusiast
Enthusiast

Hi everyone,

 

I am creating a family and I one of its elements/geometry must be able to be displayed in 3 different colors (same material) selectable by the user in the project environment.

 

So the user must be able to chose in which color this element=frame should be displayed (instance/default parameter).

Ex.: If he wishes to have the frame displayed in black, he will able to select that color option from a drop-down menu or so from the family properties palette. And if he needs to have the element displayed in yellow, he can always pick it from the same drop-down menu/properties palette.

 

As far as I know, an element can only be assigned to one material parameter. So the element can only be displayed in one color. But I need to be able to select other colors when desired.

In the last picture I've attached the dialog box in which I can only assign one of the colors to the frame/element.


Do you guys know if its possible to create a "drop-down menu" with different color options for the same material / same element? Or maybe, a workaround that creates that same effect?

yaracppereira_1-1628585991338.png

 

yaracppereira_0-1628585957877.png

 

 

 

yaracppereira_2-1628585566054.png

 

 

yaracppereira_3-1628585611198.png

 

 

0 Likes
Accepted solutions (2)
1,122 Views
16 Replies
Replies (16)
Message 2 of 17

Karol_Piroska
Advisor
Advisor

Possibly the only way is to create an instance material parameter or model few instances of same with different materials and add visibility instance parameters

Message 3 of 17

yara.cp.pereira
Enthusiast
Enthusiast

Hi @Karol_Piroska,

 

I’ve made the material parameter as an instance. But I can’t have 2 different colours for a single material.

 

I would have to have 3 different materials for the 3 different colours. But then the problem is that I can’t assign 3 different materials to a single element.

 

I was thinking that I should create a family for the frame with 3 different types/colours, and nest it inside of that bigger family.


But then my problem is that the size of the file would be very big to be utilised inside a project...

 

Any ideas?

0 Likes
Message 4 of 17

Karol_Piroska
Advisor
Advisor

you can specify several materials within the family and then change the materials within the project. 

 

material.gif

Message 5 of 17

constantin.stroescu
Mentor
Mentor

what about using the Paint tool in Family Edit Mode?

 

Constantin Stroescu

EESignature

Message 6 of 17

syman2000
Mentor
Mentor

 

Like @constantin.stroescu said, you have to edit the family editor. Then create material parameters

 

material parameter.png

 

 

When you paint, you should see paint with material parameter

paint.png

 

Paint to that surface. Once you done that, your family is able to change material parameter on the fly.

painting.png

Check out my Revit youtube channel - https://www.youtube.com/user/scourdx
Message 7 of 17

yara.cp.pereira
Enthusiast
Enthusiast

HI all,

 

I already have all the material parameters created for the 3 colors, like I demonstrated in the last screenshot.

 

The Problem: As far as I know, a single element/geometry only supports one Material Parameter. I want to have 3 materials assigned to a single element and be able to chose these colors from  a drop-down menu in the project envoirenment.

Let me start of with a real life exemple: Imagine that you have a traffic sign (BIM Object).  Traffic signs can come in many colors: red (prohibition), blue (guidance); and the list can go on.

As I am creating a generic family, I need to have an element changing colors according to its purpose. That being said, I want to associate 3 colors/materials to a same element, but I would like to make it available to be picked as an instance from the properties pallete of the family in the Revit Project Environment. 

 

That means that the solution to select the color in the project environment won't work, because I want this parameter to be associated to the family and not the be chosen by the user randomly in the project environment!

The solution for what I am looking would allow me to assign 3 different materials to the same element and be able to select the color options from the properties palette.

 

If any of you has any tips on how to achieve that I would much appreciate that!

 

Thanks 🙂

0 Likes
Message 8 of 17

syman2000
Mentor
Mentor

You may want to check this blog. It shows how you able to achieve this if you are using nested family and use formula to drive the color swap.

 

https://phil-osophyinbim.blogspot.com/2014/02/randomize-color-and-material-in-revit.html

Check out my Revit youtube channel - https://www.youtube.com/user/scourdx
Message 9 of 17

barthbradley
Consultant
Consultant

@yara.cp.pereira wrote:

 

 

The Problem: As far as I know, a single element/geometry only supports one Material Parameter. 

 


 

Are you assigning Material Parameters to the Family Geometries? Are those Material Parameters Instance Parameters? If so, each Instance of that Family in the Project can have different Materials assigned to those Material Parameters.  

 

Also, have you considered Override Graphics in View  by Element or Filter?  

 

 

....maybe this link will be helpful as well:

 

How to assign a parameter to a painted surface in a family » What Revit Wants (wrw.is)

 

 

Message 10 of 17

RDAOU
Mentor
Mentor

@yara.cp.pereira 

 

Your solution is already in your Reply #3...

  • Associate the nested family with a Label <Family Type> in the parent family...and you can select color/type from a drop down 
  • Or you could control which Color/Type is selected using a 3 x yes/no parameters in the parent family

 

RDAOU_0-1628620829066.png

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 11 of 17

RDAOU
Mentor
Mentor
Accepted solution

 

Family color options.gif

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 12 of 17

yara.cp.pereira
Enthusiast
Enthusiast

Hi @RDAOU,

 

Thank you very much.
I will have to try that tomorrow and I will let you know if it worked.

 

But the way I see it, this seems to be the solution I was searching for👌🏾

0 Likes
Message 13 of 17

yara.cp.pereira
Enthusiast
Enthusiast

Hi @RDAOU,

 

I have already tried some of the tips, but no resolution so far 😕

 

On your gif, I assume that you've nested the frame family first and only after that you've added booleans and formula?

 

I tried to nest the family but it didn't work.

I have many sizes of signs, so when I try to lock the nested family to the parent's family height width and depth parameters, it doesn't work.

The nested element does not follow along (I tried to constrain the family frame with the same (width, height and length) parameters I have in the parent family, it din't work ; then I removed all the constrains to allow all possible movements, it didn't work either), and, although I've created 3 types for the 3 colors, when I nest the frame family to the parent family it does not change the color whenever I change type. But this does work while I am on the family editor of the frame family, which is weird!

 

And regarding the booleans you've used, I how do you associate them with the material parameter, and to the family type drop-down menu?

 

I have also posted that in my social media and received a few suggestions describing that same approach you've performed in your gif... but I seem to be missing out on something!

0 Likes
Message 14 of 17

RDAOU
Mentor
Mentor
Yes it is only one formula in the parent family

The child is a simple frame LxWxF (F for frame width 2" 3" or whatever) + material type parameter and 4 types each with a material (4th type is for No frame Color picked or if user checks more than 1 color/type in parent family

The family (v2022) is attached to previous reply you can check formula and legend defining the color types used in the formula





YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 15 of 17

yara.cp.pereira
Enthusiast
Enthusiast

@RDAOU Thanks, I didn't noticed that the rfa. file was attached. Will have a look at it!

0 Likes
Message 16 of 17

MetalFingerz
Advocate
Advocate
Accepted solution

Hello @yara.cp.pereira ,

 

As suggested already, it seems a nested family with a <family type> parameter would be the best way to solve your issue. Could you share your family so we could help with setting it up ?

 

With <family type> parameters, there is a an important step that is easy to miss which is to assign the label to the geometry. The <family type> parameter will have no effect otherwise. See in the screenshots and with the example family attached.

 

Label.pngCapture d’écran 2021-08-11 à 15.35.13.pngCapture d’écran 2021-08-11 à 15.35.22.pngCapture d’écran 2021-08-11 à 15.35.33.pngCapture d’écran 2021-08-11 à 15.35.42.png

Message 17 of 17

yara.cp.pereira
Enthusiast
Enthusiast

Oh my god guys!!!

 

It worked... A very big thank you for your help, that was super amazing. Before I joined the Autodesk community I didn't realize how this could be so Powerful.

 

@RDAOU your .rfa simply saved my life. I followed everything, had a bit of problems locking the child family to the parent family parameters, but then I figured out I just had to assign the parameters I had in the parent family.
Then I couldn't finalize the boolean/formula set up without the very important step that @MetalFingerz just highlighted in his pictures.

 

Wow, I can't say thank you enough for sharing your knowledge and also for the quick response!!

 

Revit can sometimes be very frustrating, but once you achieve the so thought impossible, there are no feelings to describe!