Randomization applied unevenly to panel system


I built a simple dynamo program based on a few youtube tutorials, to randomize curtain panels in a panel system. The program uses a random seed and weighted colors, along with a short python script, to randomize the color assignments.

However, the randomization always appears very inconsistent and noticeable bands of colors form. I know that probabilistically there are only 3 choices but it still seems unlikely that so many adjacent panels would be the same color.

Here is the python script:

# Load the Python Standard and DesignScript Libraries
import clr
import System.Random


for i in range (0, amount):

OUT = randomInts

I have attached a picture of the result of the dyanmo run to demonstrate the color banding.

thank you for your assistance troubleshooting.

That’s random for you.

You can always manipulate the selection to favor “new” colors over the previous selection in order to introduce more control over the variance.


Thank you for the reply. I just noticed that there is another issue which may be related, and also more in the scope of a troubleshooting issue.

When I select individual panels, the type in the browser does not match what is selected in the model. The panel color preview in the browser seems to remain red, and the name of the color does seem to change between the three desired colors, but not actually to correspond with the selected panels. So something is possibly disconnected inside.

Script attached should you be interested. Thank you-

cp-random.dyn (2.3 MB)

It would be easier if you posted a full image of your graph (with all preview bubbles turned on so we can see what’s going on) and some images to go with what you’re describing in the model. We can’t really do anything without an example model.

1 Like

Hi Nick,

I am debugging section by section. Here is the first part of the code. As you can see, something goes wrong between node 1 and 2.

Run completed with warnings.

Some are bounded by 6 curves which doesn’t seem correct.

Well the first issue is that you’re selecting a RevitLinkInstance instead of a CurtainSystem. Extra boundary curves just means that a boundary is likely split by or intersecting something else. This causes Revit to count one boundary element two or more times, which is totally fine.

Can you also check your images before posting them? If you’re going to be snipping sections one at a time (rather than exporting the whole workspace at once) you need to be sure you’re zoomed in enough that the text is legible.