Wednesday, August 8, 2012

SLIPPING & SLIDING

Little Richard Penniman ... sure liked to ball ... Johnny Winter did an interesting version also.  The scroll bar (aka "slider") is one of the themes of this post.  That's my excuse. 

This is all Excel.  We can look at pushing back into Revit another time.  I want to explore the "diagonal ripple" that features as an animated GIF at the end of my last post.

Basically we have 2 arrays of 10x10 cells each.  Let's call the all-white array on the right "input" & the coloured array on the left "effect".  The values in "input" control the values in "effect".  So by messing around with "input" we can create different "effects".



The input array is very simple.  It is controlled by cell M1 at the top left.  As you move to the right along the top row, each cell adds one to the previous cell.  As you move down the rows, each cell adds one to the cell above.  This is very quickly created by typing the formula "M1 + 1" into cell M2, highlighting these first 2 cells, and dragging the little square in the bottom corner all the way to the right.



This technique of setting up a relationship between 2 cells then propagating it by dragging the corner of a selection is a very powerful feature of Excel.  If you are not already familiar with it, you should stop right now and practice using it.



So we have an array of numbers that is gradually increasing in size, diagonally from the top left to the bottom right.  Then we set up a slider to control the first cell.  The slider will step us through the integers from 1 to 10, and the effect will ripple down diagonally through the whole array. 




To create a slider, you need to go to "options" then "customise ribbon" and activate the "developer" tab.  This will create a new tab on your ribbon. 



Insert a scroll bar.  Stretch it to size.  Right click and choose "format contol" to open the settings dialogue.  You may have to right click several times.


Let's summarize what we have.  There are two arrays.  "Input" is controlled by the yellow cell at top left which pushes out a diagonal gradient.  Each of these cells then picks up the angle in the yellow box at the bottom and combines it via a sine formula to the equivalent cell in "effects".  The sine formula will convert a continuously rising sequence of numbers into a cycle (= a wave)  Instead of going from 1 to infinity, the numbers are now cycling between a minimum of zero and a maximum of one.


We can call it a cycle because a sine wave is the shape that a spot on the rim of a wheel traces as the wheel rolls along at constant speed.  I'm sure most of you are familiar with all this.  By the way, all these graphs are generated directly in Excel



The formula works like this.  (By the way I am a beginner at this stuff, so there may well be a simpler solution)  Take an angle in degrees, change it to radians, find the sine, convert negative values to positive.   The angle in degrees is found by multiplying the values in 2 cells.  One is a fixed location and is set to 18, the other location is relative so that the two arrays are mapped to each other.  One row of cells takes us through an angle of 180 degrees in 10 equal steps


Actually this doesn't result in a sine wave, it creates a series of camel humps.  This may be what you want, but if not, then you could simply add one to the sine values instead of converting negative to positive.  This would push the entire sine wave up into the positive side of the graph.  We don't want negative values, simply because most Revit parameters will break if you try to make them negative.  You are asking a dimension to turn itself inside out.  Doesn't work.

This is just a record of a couple of hours I spent playing with Excel, trying to build up my skill level.  I think that the ability to create oscillating cycles from a linear sequence will be very valuable.  I am certain that the ability to control a large array from two or three values place into key cells is critical.  We want to be able to generate complex patterns by manipulating a small number of simple variables.  The slider bar is very powerful tool for viewing a series of design iterations very quickly.

To summarise, I have been exploring 3 ideas

 Sine wave formulae
 Isolating key variables
 Slider bars



Go forth & multiply

But first have a look at these gifs.  Both created with old-fashioned curtain walls, some use of formulas, no Excel needed.  In both cases there is a type parameter in the curtain panel that is incremented step by step to create a series of images, which are exported one by one.  Use an image editor to compile these into a GIF.   First one uses a rotation parameter and basically a recreation of one from HERE.   http://revitdowntothedetails.blogspot.com/ (just to prove that it can be done with a standard curtain wall) 


Second one uses a thickness parameter and a Revit version of the Sine wave formula (no need to convert angles to Radians in Revit)


By the way, the rotating curtain panel makes use of Marcello's void rotation method: another little gem from RTC 2012.

http://therevitcomplex.blogspot.com.au/2012/04/rotation-rigs-that-do-not-use-angluar_28.html

Sunday, August 5, 2012

EXCEL YOURSELF

OK, so Adriel asked for a better explanation of how to assign parameters to the panels, and how to link data in the 2 worksheets.

Firstly the panels.  You need to add instance parameters to your curtain pattern family.  Normally if you want these to appear in a schedule, they need to be shared parameters, but the linking software doesn't seem worried about this.

I made mine shared, just in case I want to schedule them within Revit. 



Check the shared parameter button, click on "select" to open the next dialogue.  Now choose "edit".
First time around you will have to browse to a suitable folder and create a text file where your shared parameters will be stored.

Then choose "new group" type something suitable like "curtain panels", then choose "new parameter" and make text parameters called "X value" and "Y value" or you can use U & V if you prefer.  These 2 values will be used to identify the location of each panel in the rectangular grid.



The third parameter will be  the one that we want to vary.  In my case I called it "Thickness".  It could be "Radius" or "Angle".  Later one when you get more confident you could add several parameters to control independently.  Make sure you choose the right category of parameter, probably "length" or "angle".  It needs to be numerical if you want to use the formula capability of Revit to create interesting patterns.



Once you have the parameters set up, you need to assign each curtain panel with its correct X & Y values.  To make this easier select one panel, right click and choose "select panels > along vertical grid".  This whole column should have the same X value.

Do this for all the columns.  Then do the same for the horizontal rows, assigning the Y values.



By selecting rows and columns you can label 100 curtain panels in 20 steps: 10 vertical & 10 horizontal. 

You can leave all the thickness parameters at their default setting, because you will be using Excel to drive these values.

Now you can export an Excel file.  Follow the guidance provided with the software you chose.  It's pretty straightforward.  You will be prompted to choose the category (Curtain Panels) and choose the parameters you want (the 3 we just created)  Revit Excel Link exports a bunch of other parameters that it uses (unique ID values for example) and these are all coloured blue.  The headings are coloured grey, and the data you created is left white. 



You will need to organise the data so that the X & Y values are in the right order.  Select all the white & blue cells, then go to Sort and filter.  This will allow you to sort first by X, then by Y while leaving the headings undisturbed.  These are pretty basic Excel skills.  If you don't have them you will need to spend a bit of time getting familiar with the programme, so that you can start to take advantage of the power it has.  

Once the data is organised you need to open a second worksheet.  Have two windows open so you can see the 2 worksheets side by side.  Now create a rectangular array of data in your second worksheet.  Curtain wall was 11x11 so I have and array of this size.  You can populate this grid with data, using simple formulae at first.  You could have a formula that simply adds 50mm each time you move once cell to the right. 



Now you need to link this data to the first sheet.  The key idea here is to take a set of vertical columns and stack them one on top of the other.  Select each column in turn.  Copy to clipboard.  Move to the other worksheet.  Select the matching portion of the vertical stack.  Paste from clipboard.  The data will come in as links.  Worksheet 2 is now driving the data in Worksheet 1.



In the example I show above I have set up a more complex system with values based on a sine wave.  The starting value of the top left hand cell is controlled by a slider bar.  As you move the slider, the pattern ripples across from left to right.  More on this in a future post.


By way of acknowledgement.  The gif was inspired by some nice work on a newish blog here:   http://revitdowntothedetails.blogspot.com/

Wednesday, August 1, 2012

MACAVITY UNMASKED

You may seek him in the basement, you may look up in the air--
But I tell you once and once again, Macavity's not there!  (T S Elliot)

This post is all about drawing things that aren't there, or shouldn't be there.  How to make things disappear perhaps.  And it's about cavities: cavity walls, service ducts, boxed out bits of nothing.  At GAJ we do quite a lot of resorts, often with a middle eastern village feel.  They tend to have thick walls with niches all over the place.  The external shell  is probably concrete block, cavity wall construction with wet-trade plaster inside & out.  Awkward junctions can result.



The internal walls that are boxing out to form niches are breaking through into the external cavity wall and preventing the corner from healing nicely.  The "edit wall joins" tool fails to find a good solution, so I resort to "disallow join", then drag the offending piece of wall back, and "join geometry".  Not perfect, but much better.



We don't want plaster on the inside of the duct.  I could make wall types that are only plastered on one side, but this means cutting walls up into short lengths, so let's try a different solution.

I could use a masking region, but this is like going back to CAD drafting ... separate regions in each affected view.  What if I place the mask into a generic model family?  If this family has a vertical model line (use invisible lines) the masking region will show up in any plan where the cut plane intersects the model line.



Extending this idea into 3 dimensions I can create a family with 3 model lines (X,Y,Z) and 3 masking regions.  Give it instance parameters to control the size of this "virtual box" and it will mask out the finish layers for any view that cuts through the duct at right angles.



Another issue with cavity walls is how to show the finishes returning at openings.  I realise that this type of construction will be unfamiliar to North American readers, but it's fairly common in other parts of the world.



You can make the door and window families force materials to turn the corner.  This will affect those layers of the wall that are outside the core.  You can also make this the default behaviour for the wall. 



But I have to be honest & say that Revit is not brilliant at doing this kind of construction.  We usually end up with a few intractable junctions that just won't clean up nicely.  You can resort to drafting, you can try to embed complex sill & jamb details into window families.  But at times it all seems a little forced. 

The truth is that this kind of old-fashioned, wet-trades building work is a tough nut for BIM software to crack.  Things that are quite easy for a tradesperson on site to solve on an ad-hoc basis are problematic for the rules-based, automation of a software system.  How do you allow for all those one-off situations ?

Maybe one day we will have BIM programmes that show individual masonry units and have the intelligence and flexibility to allow me to easily explore different bonding solutions, to remove the plaster on the inside of ducts with a quick hand-gesture or vary the joint size of a particular course using a slider-bar.