TheSwamp

CAD Forums => CAD General => Dynamic Blocks => Topic started by: Daniel J. Ellis on May 05, 2016, 03:45:40 AM

Title: Array to Zero (0)
Post by: Daniel J. Ellis on May 05, 2016, 03:45:40 AM
The next dynamic block I'm struggling with is a corner sofa (attached).

I've used a combination of stretch and array actions to allow the number of seats in the x and y directions to be changed - as shown in the screen grab.

The problem I have is when I try to reduce it to a single-seat in either direction: I get an extra "middle-seat" to the side.  Essentially what I'd like to do is have the array "reduce to a zero length" so that it doesn't produce a single instance, but I can't find a way to do this.  Can anybody suggest anything?

Thanks in advance (block's attached).

dJE
Title: Re: Array to Zero (0)
Post by: mjfarrell on May 05, 2016, 09:06:34 AM
you will want to set minimum distance for the stretch such that one can only stretch
and repeat cushions (seats) in whole increments.
Title: Re: Array to Zero (0)
Post by: Daniel J. Ellis on May 06, 2016, 03:21:21 AM
Thanks for the suggestion but I've tried that and it doesn't help.

Using that means that ADDING cushions works fine, it's when I don't want any middle ones that it fails.

dJE
Title: Re: Array to Zero (0)
Post by: mjfarrell on May 06, 2016, 08:33:45 AM
Thanks for the suggestion but I've tried that and it doesn't help.

Using that means that ADDING cushions works fine, it's when I don't want any middle ones that it fails.

dJE

you would want to build it so there IS no middle one in the default state, and then only after stretching it the right minimum distance(s) do the intermediate
(middle) cushions appear.
Title: Re: Array to Zero (0)
Post by: Daniel J. Ellis on May 06, 2016, 08:59:08 AM
You would want to build it so there IS no middle one in the default state, and then only after stretching it the right minimum distance(s) do the intermediate
(middle) cushions appear.

That's what I've been trying to do but haven't been able to find a way to do so.

I've found a solution based on lookups and visibility states (which should make for a pretty complicated block because the whole project started with using visibility states for activity zones!).

I'll write up and post what I do once I get the block finalised...

dJE
Title: Re: Array to Zero (0)
Post by: mjfarrell on May 06, 2016, 09:01:48 AM
IF I were not slammed with a project, I would take a run at an example...see if I hit the same sticking point or not.
Title: Re: Array to Zero (0)
Post by: Daniel J. Ellis on May 06, 2016, 02:16:38 PM
Know the feeling - this entire project is made up of ten-15 minute stretches grabbed from the odd lunch break when I can.

Thanks for the help.

dJE
Title: Re: Array to Zero (0)
Post by: ChrisCarlson on May 06, 2016, 03:43:39 PM
You have to modify the min. distance parameter for Dist-y-Axis-Main and Dist-x-Axis-Main, this will allow you to stretch to have no "center" section. Currently it's set to require the corner section and one sectional as the min distance is 1467 (850 + 617).

Just note you need to adjust your stretch windows or you'll criss cross (what I assume) to be the clearances?

Also when you go to array 0 as you call it, the end (arm rest?) intersects with other lines. 

Does it matter if your corner piece is 850 x 851?
Title: Re: Array to Zero (0)
Post by: Daniel J. Ellis on May 08, 2016, 06:30:26 AM
You have to modify the min. distance parameter for Dist-y-Axis-Main and Dist-x-Axis-Main, this will allow you to stretch to have no "center" section. Currently it's set to require the corner section and one sectional as the min distance is 1467 (850 + 617).
  What should I set it to?  It's currently set to be one corner section and one end section.

Just note you need to adjust your stretch windows or you'll criss cross (what I assume) to be the clearances?
Yeah, knew about that, thanks - figure that's gonna be a relatively easy fix when I get the array issue fixed :)


Also when you go to array 0 as you call it, the end (arm rest?) intersects with other lines. 
  That's the problem in the first place!  The block's based around a corner piece which stays put; an end section with the arm rest which stretches; and the middle section array.


Does it matter if your corner piece is 850 x 851?

I'd not considered that circumstance. - I suppose I better had now lol

dJE
Title: Re: Array to Zero (0)
Post by: ChrisCarlson on May 10, 2016, 03:26:35 PM
To me the easiest workflow would be to have two maybe three blocks. My suggestion is this

Block A - Corner sectional with (4) vis. states (2 look up table grips). One with no sections, the second with an X, third with a Y and the 4th with both X and Y.

Block B - Sectional only block with dynamic stretch / array
Title: Re: Array to Zero (0)
Post by: Daniel J. Ellis on May 18, 2016, 04:09:41 AM
Soo I finally got this working, and the finished block is attached below for anyone who wants a look.

I redefined the geometry to run off a single linear parameter in each direction.  This runs the two arrays, both of which are set to a minimum value of 0 and increments of 616 (the width of the middle seat).  I then tie these into a pair of stretches which position the end seat at the end of the array.

Also in the same two stretches are a pair of lines which are used purely to generate the overall sizes to be used in fields in the attribute (this is why I stretch the end pieces rather than use moves).

The real "magic" to make the middle pieces disappear when necessary are managed through a combination of lookups and visibility states.  The block includes options for three different types of activity zones (none or Furniture Only as I call it, HQI, Lifetime Homes, or mobility).  Each activity zone option needs four states - 0x0y, 1x0y, 0x1y, and 1x1y depending on whether the horizontal (x) or vertical (y) intermediate seat is needed.  This leaves me with 16 visibility states in all!

So from a user's perspective it starts with a lookup to select the usage zones tying into the 1x1y visibility state for each ("Choose Zone lookup" screen grab).  In each "zone state" there is a pair of lookup which read the two linear parameters and use them to set a code based on their value. And is shown in the "calculated lookup" screen grab attached.  The Final Lookup, also attached as a screen grab, takes the code generated from the distance calculations to set a final visibility state.

Thanks to everyone on this thread who helped with the block, and I hope this post will be able to help someone with a similar challenge in the future.

dJE