CAD tip # 12046:
Question
The core of such dynamic designs is driving dimensional parameters by iLogic rules and using the functions Rnd(), resp. Randomize(). You can of course control any type of parameter - fillet radius, number of array elements, bending angle, etc. For the specific macro code, see below.
Let us first create the basic 3D model. We will use a simple box, sizes of its sides will change randomly (independently), but their average sizes will be close to the ratio 1:2:3. Start with a 2D sketch in the XY plane, a centered rectangle - so that the box position will not jump when its size is changing. The rectangle sides will be driven by the parameters d0 and d1:
So that the macro "auto1" will be run on every update of the part, assign it (by mouse dragging in the direction of the red arrow) to the event "Change of the part geometry":
Let's try now to use our random part in an IAM assembly. Insert multiple occurrences of the Díl1.ipt part to a different fixed positions (no constraints) into a new assembly. The function "Rebuild all" - applied in an assembly - again creates a pseudo-randomly generated shapes and appearances, but you can see, that the single source of the part geometry results in a single, unified appearance of all its occurrences in the assembly:
If you need to have all assembly parts in their own, individual appearance and size, you will first need to copy the Dil1.ipt file to multiple individual copies and then combine them by inserting/placing into a single assembly.

