like object programming - encapsulate the objects. if the picket is simple, then create as a group and use the master to host the parameters and things like "count" etc, then in the group (picket) simply use the Copies and simple space rules to lay them out. if the pickets need to align end to end and the space can vary slightly, then compute that in the master and create an adjusted space after computing the number of pickets you can fit in a given length. or if spacing is important, compute the final size picket (in the master) and IF(Copy=Copies, last_size, normal_size). on align, IF(Copy=Copies,Master!LenX-normal_size,Copy * (normal_size+spacing)) etc.
if the object is complex, then make it a component with everything it needs to function but remember to pass parameters to it from the master otherwise using the component options UI will not work as sub-components do not surface their parameters to the UI. likewise you cannot reference the parents parent so you need to pass parameters on the components.
it can be frustrating. i've spent a few days making dynamic stud wall framing which has a feature to prevent end studs from overlapping because i wanted them to be usable for 2D drafts. yikes! and even after you test and test, there's always a glitch which needs adjusting... i'll get it eventually... it would be great if there was a native API which could be used with Ruby scripts to i could use/replace some of my scripts as plugged into a DC as the math in a DC will not properly support some of the math needed...
picket_fence.skp
