Randomize types in divided faces

I have a problem regarding randomization in divided faces, by changing types in the face.


Is it possible at all to change elements i faces by type, or is it only possible to change data in parameters?

Could someone please help me, see if I am doing something wrong, I can’t figure out how to change instances in divides surfaces.

It needs to be changed as types, for counting the amount of different types, after randomization.


sorry for all the extra lines, but it is impossible to edit a post afterwords, and i can’t delete it, and redo it!?

Your panels are hosted in divided surfaces inside an in-place mass. As far as I know that means no changing of panel types from the outside (you can’t do it in the Revit UI unless you’re inside the in-place mass). I would suggest either working with a conceptual mass family instead (and have Dynamo change the family types there) or not using divided surfaces at all (and applying the panels directly onto the in-place mass in a random fashion using Dynamo).

I have now solved the problem, by using a mass family instead of in-place mass as suggested. I have decided to show my solutions for both instance and type driven facades. The two solutions demands two different approaches.

Instance: This solution uses Dynamo elements out of the box


First step is collection the different divided faces (in all 4 faces with 16 panels). When this is done, the script will set randomized values for X, Y and Z in the element used as facade panel. Watch will confirm what the script is doing.

Downside on this solution is that is not possible to count “types” since all will be slightly different. In the real world will it be a range of types that needs to be randomized. In addition to this, one need manually to select the divided faces in the geometry.

Type: This solution uses Lunchbox and Clockwork packages


In this solution the instance parameters for X, Y and Z is changed to be type driven, and in this case done by creating four different types. This gives the advantages, that it is now possible to let the script collect the used types in the mass family, you don’t need manually to select the instances as before!

For randomization is used Lunchbox Random Numbers, since it adds the opportunity for ‘seed’, min. and max. in one node (custom node). In this case the seed is driven by the time the script was opened. There is also included a integer slider there can be used instead. For changing the types is used Clockwork FamilyInstance.SetType. Watch will confirm what the script is doing.

Downsides… none :slight_smile:

Hints/questions for Dynamo coding group:
Why isn’t Time controlled by the ‘Run’ bottom? Why should I be interested in opening and closing the script for running my script with different seeds? I would expect that DateTime.Now really is ‘now’ and not ‘in the past’ :slight_smile:

Please include options in the Dynamo out of the box solution as this randomization (Lunchbox) engine and possibilities for changing (Clockwork) instances of types in a project.

Zip files for the two solutions.




Erik, thanks for sharing your work.