Dynamic Component with "copies" in the X and Y axes

Hello everyone, I’m currently breaking my head over coding my DC (Dynamic Component) to COPY its properties in both the X and Y axes without generating additional component columns. Initially, I believed this task to be impossible, but I recently encountered a tile DC that appears to accomplish this seemingly magically. Could someone assist me in understanding the formula or method used to achieve this?

Specifically, I’m referring to the internal component where circles are multiplied by a value (X&Y) and then equally placed according to the primary DC parameters.

I attached the SU file with Components in it.
DC24.skp (382.3 KB)

:wave:Hey, this is new to me as well, but it has to do with the second multiplier:

=(COPY-(FLOOR(COPY/GridExample!copiesX)*GridExample!copiesX))*GridExample!TileSizeX

Maybe @pcmmor could give us a breakdown on exactly what is going on?

1 Like

Tx @rwamoore,Yes! I tried to work with this format but i couldn’t make it work for my DC, there is a FLOOR code there too wonder if that has anything to do :face_with_spiral_eyes: :pray:

Guys I’m going nuts here, how did he do it??

1 Like

Thats me trying to replicate :grimacing:

I still have not figured it out either, but i slipped your geometry into the working one… so there’s that at least?

DC24 edit.skp (377.4 KB)
Screen Shot 2023-12-08 at 12.36.33 PM

Tx rwamoore, but its now a fixed component, not anymore dynamic, wonder where I can find an export I’m willing to pay.

Huh, weird. Don’t understand why that breaks it… the lines inside the tile component shouldn’t affect the way the DC works… Someone with knowledge of this voodoo please help us!

Ceiling takes an argument to next integer if a second argument is not specified, whereas floor to lowest integer. The second argument is assumed to be 0

floor(1/3)=0
floor(3.141)=3
floor(4/3)=1

from this one can see a method of selecting a row based on number of column, by dividing the number of cells by the num of columns

for 2 columns and copy (cells) copies=4
row=floor(copy/number of columns)

0=floor(0/2)
0=floor(1/2)
1=floor(2/2)
1=floor(3/2)
2=floor(4/2)

if you add second argument, result is lowest of that argument for floor whereas ceiling highest
floor(6.525,0.5)=6.5
floor(6.8699,3)=6
ceiling(6.8699,3)=9

3 Likes

Scaling Issues

before swap check there is no scale factor, then make sure fully unique, I find best copies =0 , swap size for size.

OR could use the exist as grid, hidden with new object in that boundary

2 Likes

@pcmoor , thank you for your guidance! I’m not the best in C++, but I’ll do my best to figure it out in my situation. Thank you so much! :blush: :blush: