how to make a smarter shelf?

Started by kennyj, May 01, 2013, 02:42:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kennyj

Hello:

I have a simple shape for a shelf that aligns itself to the top, or bottom of a cabinet, depending on if its data field is set to ='top shelf' or 'bottom-kick', using SETF in a nested IF. (see attached)

I also want to have a behavior for if the shelf type is set to 'adjustable', but I'm not sure how to achieve this, since it's the opposite problem. Instead of fixing a Y position, I want the Y position to be changeable in this case.

Further - I prefer to limit the possible Y values to every 32mm, which is the centers of the line-bored holes in the panel.

So Ideally, if shelf is set to 'adjustable', each tap of the arrow keys would move the shelf up or down an increment of 32mm.

Would someone kindly explain or show me how to achieve this?

Thanks!

Kenny

aledlund

Kenny,
A lot of what you have described carries with it an assumption on how the rack/cabinet shape was created. As background you might investigate over on visio café how the different vendors created their racks, specifically focusing on the  relationships between on how the connection points (the shelves) are laid out in the connection section of the shapesheet.
al

kennyj

#2
Thanks Al,

I will definitely go check that out, in fact I was considering the similarities with server racks, and I bet I'll find a few ideas for shape behaviors there, but didn't know visio café was the spot to investigate - so thanks for that :)

Meanwhile, unless I learn something there that changes my strategy,
currently I build the cabinet shape as a group of 2 vertical panels, a top shelf, bottom shelf/kick, all of which are pretty much straight forward.

I have regular connection points at every location where a hole would be, which is every 32mm in parallel to the vertical panel edges - beginning and ending 10mm from the panel ends. 

So, it might actually be two different questions, 1 for immediate working solution, 2nd for my ideal.

The immediate question is, with my shelf design such that setting type to topshelf or bottom shelf automatically places the fixed shelves in their proper location using SETF, Is there a simple way to modify the formula to handle letting the same shelf be freely adjustable along the Y axes?

Here's the current formula matching the attached shelf vsd:

=GUARD(IF(STRSAME(Prop.shelf_type,"top"),SETF(GetRef(Prop.Y),"guard(Prop.section_height-Height/2)"),IF(STRSAME(Prop.shelf_type,"bottom-kick"),SETF(GetRef(Prop.Y),"Guard(Prop.kick_height)"),IF(STRSAME(Prop.shelf_type,"adjustable"),SETF(GetRef(Prop.Y),"500mm"),""))))


So the first two If statements set the Y position, which is thereby locked in place, the final If statement is a placeholder that sets the Y position to 500mm, but instead of that, I need to just let the Y position be adjusted, just like any plain shape would be, by using the up/down arrows.

Any thoughts on this? Or do I need to approach differently or use a separate shape for adjustable shelves?

The second problem, and one that I might discover a potential solution by studying the rack diagrams, as you suggest, is:
How to makes things such that the adjustable shelf moves by up/down arrow, but in 32mm increments?

In this case, I do have corresponding connection points, so I don't know if its a matter of using some implementation of the Snap functionality / setting up of the grid spacing, etc. Or if it's some code that runs on a move shape event, which then jumps it by 32mm increments, or if it's code triggered by a arrow button click, or whether it's somehow built into the shapesheet formula.

Any thoughts on that one, or do I need to study those rack diagrams first to get a baseline?

I'm hoping to get at least the 1st question sorted out today, I can take a little time to figure out the second question if need be.

Thanks again,

Kenny


Jumpy

Could you show the formulas in the other involved cells?

- PinX/PinY or BeginX/Y - End X/Y
- Prop.Y

and in what cell is the formula you posted in #3?

kennyj

You bet. I also attached the vsd in the original post, in case that's easier.
I think I included everything that's relevant below:

PinX: 61 in
PinY: GUARD(Prop.Y)

User.Set_PinY: GUARD(IF(STRSAME(Prop.shelf_type,"top"),SETF(GetRef(Prop.Y),"guard(Prop.section_height-Height/2)"),IF(STRSAME(Prop.shelf_type,"bottom-kick"),SETF(GetRef(Prop.Y),"Guard(Prop.kick_height)"),IF(STRSAME(Prop.shelf_type,"adjustable"),SETF(GetRef(Prop.Y),"500mm"),""))))

Prop.Y:  GUARD(Prop.section_height-Height/2)

Prop.shelf_type:
     Format:   ="top;bottom-kick;adjustable;locking;fixed;bottom-flush"
     Value: INDEX(0,Prop.shelf_type.Format)

Prop.section_height:  "2164mm"
Prop.kick_height: 74 mm



Thanks :)

-k