Program model to add copies when scaling

i am programming some roller blinds so that when you scale up or down more slats are added however 1 of the parts has parts on it that should at the base so the idea is the bottom slat stays the same and more are added or taken away when the user scale the model up or down

Is a good example to crib from…

something like that this is the model and the slats to expand when the user make it bigger in hight but no change when scaling left and right but this is the model roller blind | 3D Warehouse

Could you organise the model to hood, tracks,slats

name the groups, the repetitive group,
delete extra tracks…

place axis (right click on it to get menu)
then post model here

i have done that the link is roller blind | 3D Warehouse

A fair attempt. this will improve as you gain more experience

Its very important to organise the model well if you are trying to do complex operations. I have named all items, deleted the redundant and place the glueing plane which is required for this type of component. All internal axis are aligned and placed at what maybe strategic positions.(hood is stationary, guide grows down)

I want you to use Outliner to compare the model attached to your own. Now at no stage have I bothered with attributes until most if not all the model is organised

roller-blind.skp (127.3 KB)

First fill in just the len sizes which will be fixed on the children, by replacing say 120cm with =120
you will notice that some of your sizes are very decimalised, for future models I suggest you make them to the one or two decimal places for ease of checking.

then create a formula which changes the length of the guilds, something like length of guide = Roller Blind LenY of the model minus the hood lenZ.
(using LenY, due to use of glueing plane)

to stop the recurring effect of using LenY one uses = current(“LenY”) however you will note for metric users it returns inches so we have to use = current(“LenY”)*2.54

…what I call the 2.54 bug
this occurs in material calculations and animation, so for more complex animation models I keep to inches

However you can place = current(“LenY”)*2.54 in the LenY value of the parent (Roller Blind)

next positions
Z value for base slat will be same as lenZ of guide minus lenZ of base slate and slat

the slat that repeats
Z value slat will be base Z plus lenZ of slat…

copies = (lenZ of guide minus lenZ of base slate and slat)/lenz of slat expressed as an integer
copy position Z now becomes base Z plus lenZ of slat times copy

note: use copy not copies in the formula, copy return the copy index of copies

This is a guide and not a absolute solution…try it…then post, will fix if required…and do steps if required…

Since there was a few issues with explanation above, in that I mix up Z for Y due to the glueing plane, although I believe you may have got the jist of the solution. I decided to post an update with the attributes filled in

roller-blind.skp (145.0 KB)

thanks there’s a few issues that im stuck with is that the top the slats dont meet the base of the hood when i expand it upwards how can fix this. but also i would want to add a pully system so that the cable would would expand when stretched vertically

i have updated the model with the pully system in place but when i a scale it. it comes out all wrong

as previously said, this is not a complete solution, so behaviour needs to be restricted if required, so setting the hood position to fix value should work, The addition of extra objects need to be divided in to fixed sizes and positions and variable ones. I would like you to do this in order to learn, I will post a solution later if you can’t solve it. But please try… its the only way to learn

i have a good try of doing it but it does not come out correctly. i have maniged to set it so that the right number of slats are added. this means that there is not a gap at the top between the hood and the top slat

i have updated the model with the pulley system. but i have also tried fixing the knobs that when scaled distort in size and when i set them to be fix they move off the model completely

Had a look, you are getting there…

the cord should be made of 3 parts, one as a top arc fixed on the hood, the second a middle that stretches, the third the bottom hoop, should be fix in size but able to move with the scale. with a formula relationship

I’ve added another concept for you to consider, such that instead on creating the slats on scale one can create them on animation

click the red cubic to activate, click same to return, if you click a yellow then that copy will move. So probably use the hood as the trigger point on your model

slat animation.skp (15.7 KB)

When building a model its best to fix all the sizes, even in the sub groups, and name them. Then fix the positions. The position is always relative to its containing group or component. This is why I recommend that you name every part so that it is easy to locate then in Outliner. You can use outliner to move quickly within a very complex model and use some of the right click menu options, plus you can move sub or components around by dragging.

So to edit a sub-group, make sure the parent is showing in the upper part of the attribute dialog. Keep in mind that this parent may be a child to another, So you need to disengage or work at a higher level first.
If a part goes flying then first try the redraw on the parent. if that does not work then undo and try working at a different level .Sometimes deleting the parents influence seems less frustrating…, then add its restrictions or formula after.

i have a go at doing the naming and when i expand it its all correct as the middle cords don’t move out of place the only part im stuck with is trying to word out what calculations i put in the cords and how to stop the knobs from going flat when you expand it sideways and stay in pace

corrected cord, added hide function

roller_blind (1).skp (226.8 KB)

thank-you what about the knobs at the base slat they keep squashing what setting can i add to make them stay the same. i have also noted that the base cord to the middle cord has gaps sometime when expanded is there a way to fix this

i have fixed the gaps in the cords but the top cord is not the same with as the middle and base cord