Create Random Family types on a Grid


I have tried a few different methods with the same result, a crash. what i am trying to do is place a combination of three different types of families on a grid in a random pattern. i can achieve everything accept for the randomization of the 'family type" or "family instance". I first tried to create a random placement of 3 family types, this method didn't work at all. the second method i tried was nesting a component with 3 family types into a family and creating an instance parameter for the type label. this works in theory but every time i try and run the script it crashes.

any suggestions would be greatly appreciated.

Hi William,

the problem with your definition is that it lacks a conditional statement that evaluates the random number and tells Dynamo which family type to pick for a specific value range of the random number.

Have a look at the example I posted here a few days ago: Family Type from Image

You can use the custom node I created as a blueprint for your own evaluation function. In your case, you will have to nest two IF nodes in your custom node, because you have three family types - not unlike nesting if-statements in Revit formulas.

Also, when working with the random node in Dynamo, be aware of how it works. A very good explanation can be found on David Wood's blog here:

here is the definition