PDA

View Full Version : Is there a way to get a random material?



mike99
2012-10-17, 01:14 PM
just like the image below,random color

damon.sidel
2012-10-17, 02:00 PM
It would probably require a script. This doesn't look entirely random, though. My guess is the colors were chosen based on some logic, which would make a script even more interesting IMHO.

Alfredo Medina
2012-10-17, 02:08 PM
It is possible, by using divide & repeat. To make the randomness, the item that repeats should have a parameter that controls the distance to a certain point that is adaptive, and which can be moved after the object has been repeated. Based on that distance, which would be different for each panel, a material parameter could be driven by a formula, producing the effect of different materials for each panel, from a pre-defined group of choices for material.

mike99
2012-10-18, 02:23 AM
nice idea! I will try it again

mike99
2012-10-19, 01:51 PM
I failed again,when add a simple parameter to the "DD",a material parameter, revit show me that "Can't define the parameter by formula". It means that a material parameter can't be drived by formula? or other meaning?
Could you show a bit more about itto me?

mike99
2012-10-19, 02:06 PM
just find this in the help docement,2012, but now I already got 2013,

damon.sidel
2012-10-19, 02:27 PM
I think you can do it. Let's say you want 3 materials for example. In your adapative component, create 3 copies of the geometry you want to change materials. Assign each, one of the three materials. Assign each a visibility parameter, call them V1, V2, V3. You'll have a distance parameter, call it "D" for the "free" adapative point. For each visibility parameter, set up formulas that reference the distance parameter like this: V1 = D<10000, V2 = AND(D>10000, D<20000), V3 = D<20000, assuming units is millimeters. Then when you apply the adaptive component onto your surface and move the "free" point around to different distances, when that point is less than 10 meters away, it should turn on the V1 geometry in the component and turn V2 and V3 off. Similarly for the other ranges.

Another idea: The "free" point of the component could be hosted on a spline curve to use as a controller. As you adjust the curve, it would change the distances for ALL the components once hosted so you'd get a more interactive control.

mike99
2012-10-19, 03:03 PM
I think you can do it. Let's say you want 3 materials for example. In your adapative component, create 3 copies of the geometry you want to change materials. Assign each, one of the three materials. Assign each a visibility parameter, call them V1, V2, V3. You'll have a distance parameter, call it "D" for the "free" adapative point. For each visibility parameter, set up formulas that reference the distance parameter like this: V1 = D<10000, V2 = AND(D>10000, D<20000), V3 = D<20000, assuming units is millimeters. Then when you apply the adaptive component onto your surface and move the "free" point around to different distances, when that point is less than 10 meters away, it should turn on the V1 geometry in the component and turn V2 and V3 off. Similarly for the other ranges.

Another idea: The "free" point of the component could be hosted on a spline curve to use as a controller. As you adjust the curve, it would change the distances for ALL the components once hosted so you'd get a more interactive control.

Nice! new way to get it. I will make another try. Hope to post a new image of mine

mike99
2012-10-19, 03:29 PM
I find this in the wikihelp just moment,it means that I can only control 2 materials?
the "MuntinVis", is a visible parameter

mike99
2012-10-19, 03:46 PM
I tried this one, but the revit tell me that"this parameter is not a valid family parameter"
so, what is correct word in that position? I tried such as,on-off,true-false,1-0,visible-invisible,yes-no, and failed.

CADastrophe
2012-10-19, 03:57 PM
I tried this one, but the revit tell me that"this parameter is not a valid family parameter"
so, what is correct word in that position? I tried such as,on-off,true-false,1-0,visible-invisible,yes-no, and failed.

If that's a formula for a Yes/No parameter, is should be: " and(a > 2500 mm, a < 3500 mm) "
*btw - I reversed the symbol in red above assuming that you want it to be "Yes" if it's between 2500 mm and 3500 mm

You do not state a "yes" or "no" value for Yes/No parameter formulas - it's determined by True/False statements.
For example, the formula "1 = 1" will return "Yes", while the formula "1 = 2" will return "No".

damon.sidel
2012-10-19, 04:06 PM
Oops, Corey beat me to it... but here is an attempt.

mike99
2012-10-20, 04:26 AM
Great AUGI!!
I love this place

mike99
2012-10-20, 07:41 AM
at last I got this,take a look,sure it could be better,
thanks to all of you,