Copies DC attribute

Could someone brighter than me help here? I am trying to understand the copies attribute when making a DC. I have read the Knowledge Base about picket fences. What I want to do is similar but different enough not to just replicate the formulas used for fences.

I want to create a glazed screen that has upright frame sections (jambs and mullions) which, for simplicity, would be identical. I want to be able to use the Scale tool to set the overall width of the frame. Uprights need to be at a maximum of 600mm apart in my example and at regular centres. So, when you stretch the frame, the number of mullions would increase to suit. There would be uprights to begin and end and a variable number in between.

The Copies attribute correctly returns the number of uprights required but where I am coming unstuck is in making the replication work. At present, replicas are being made but on top of each other and in an odd location. So I suspect the formula that governs that is wrong. Can anyone spot the error?

BTW, this model only has uprights at present. Once I have mastered the uprights, I will add head, cill and glass. Of course, the number of glass panes and their size and disposition also needs to be controlled by the copies attribute.

Draft.skp (297.6 KB)

I’m not very clever with DCs myself, but have made two which are similar to what you want to achieve.

In the scaleable frame, I specify the number of copies as an input parameter in the parent frame, then reference it in the subcomponent (corresponding to your mullion) to place the crosspieces where they need to go to be equally spaced.

But Copies is calculated in the Picket subcomponent in the picket fence.

Frame DC - scaleable.skp (59.9 KB)
The second is on the 3Dwarehouse - here:

It’s a while since I did them, but you might have a look at the code to see if it could help you work out how to do yours.

@john_mcclenahan Thanks, I’ll work through that and see if I can understand it. In the meanwhile, I have got a little bit closer to what I wanted as you can see in the attached file. The uprights are now replicating at equal intervals as I wanted. However, the spacings between uprights is always fixed at 60cm so you cannot stretch to any length and have the spacings vary to suit, which is what I was after. More tweaking I guess!

Draft.skp (299.1 KB)

I am very close to what I want with this latest iteration but I am being frustrated by one last hurdle I cannot get over.

I now have a DC that correctly populates with the number of uprights, at regular intervals, and with an overall constraint for maximum spacings. But it still won’t allow me to stretch to any length I want.

I would normally just use the scale handles to stretch the DC but I have constrained the overall length to 300cm to illustrate what is happening. That constraint is not read as a constraint. Something is overriding it. I suspect it has to do with the Copies command which I may not have fully understood.

Can anyone solve this las little conundrum for me?

Draft.skp (301.7 KB)

I’m out at the moment and answering on my phone, but should be able to look at home in 2-3 hours, if no one else gets there first.

@john_mcclenahan That’s really kind of you John. I think I may have cracked it though. Take a look at the updated file attached. I now seem to be able to stretch to any size and it populates with the right number of uprights at appropriate spacings. I have also added in some glass which replicates in the same manner. I can now add detail like depth of uprights and head and cill members. I can also make the maximum spacing user definable. In short, everything I wanted.

I confess there was an awful lot of trial and error in getting here, and also quite a few educated guesses! I may not have hit upon the most elegant way of using the formulae so I would be interested if anyone sees a better or more compact way of achieving the same thing.

Draft.skp (315.9 KB)

Sounds as if you’ve got it cracked! Good for you.

I found I needed a LOT of trial and error, and every so often had to start over - DCs seem to remember some things you hope they would forget, and only a ‘start over’ clears that.

Just looked at the code. Can’t think of a simpler way to do it.

A few other comments:

  1. For the Frame, don’t set X=0: that forces the DC to sit with its bottom left corner in the Y-Z (green/blue) plane. I’d expect you will want to put it anywhere.
  2. You probably intend this, but haven’t got round to it yet: Give the user some Options to set in the Frame component: for example, overall height (or make that scaleable too, optionally with horizontal mullions as well as the vertical ones you already have), mullion Breadth, and mullion Thickness.
  3. And perhaps make the beginning and end mullions a different width and thickness, or perhaps even make them part of the Frame component, which I expect will need sides and top, if this is to become a window component.
  4. The left mullion is front face out, the others are back face out - probably you will want to pushpull them to some thickness so it makes sense to have them that way round, but the left one should probably be the same way round, or be replaced like the last one by a Frame vertical component.
1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.