Randomizing Element Groups Based on Selection

I have a graph that I use to randomize elements on site (plantings, vehicles, etc) and it works great for that. I just tried to use it randomize some groups and Revit threw an error on all of the groups that are not on the same level as the reference groups. Is there a way to actually randomize the groups without Revit throwing a fit because the level / host is different?

The elements in the groups in this case are plantings from Enscape. They are not Workplane based, but they do associate to a host in the model.

Create one group and locate around the model as needed.
Duplicate one instance of this group N times and modify to create some variety.
Disconnect the rotation, because I don’t want it in this instance.
Run the graph and randomize which group is where.

Graph, screenshot, & error message from Revit enclosed:
SetEntourageRandom-FromSelection.dyn (35.5 KB)

2022-09-21 12_25_15-Window

Chad, I know you know Revit really well but I am going to ask some basic questions anyway.

When copied to a new level does a different host exist in relatively the same place?
Have you tested this on the same elements but outside of a group?

Potential workaround: Is it possible to include a host for the elements to live on in the group? That way there is no hosting outside the group.

edit 2: Basic questions are good- it is way to easy to miss something super basic, like I did (see edit 1)

For testing I just made a blank file, placed a few plantings, and created a couple groups. 1/3 of the plantings were hosted just to the level, 1/3 are hosted on a floor, and 1/3 are hosted on a floor that is included in the group. Then I copied them up to 3 additional levels and tried to randomize and got the same error. There is a level at each location for them to host to, and on the group with a (non-grouped) floor, there is also a floor.

Randomizing when they are not grouped works with no issues.

Oddly, if I just use Match Properties the groups will swap out with no problems, it is only if I try to use Dynamo to change them around.

edit 1: I’m a moron. The graph is set up to randomize families (FamilyInstance.SetType), not groups… Definitely a Monday :man_facepalming:


Been there too many times

1 Like