BILT Speaker

BILT Speaker
RevitCat - Revit Consultant

Thursday, 17 October 2013

How to Schedule Panel Locations on a Flat Rectangular Surface in Revit



This post demonstrates how it is possible to schedule repeater component cell numbers on an orthogonal pattern within the Revit Conceptual Massing or Adaptive Component environment:

To set this up, first you need a rectangular surface, which has been divided; then you need to place an adaptive component onto the node(s) of the surface; once arrayed in two directions using the repeater function you can schedule the cell (column and row) numbers on the divided surface.  Of course it isn't that simple - the adaptive component has to be aware of its location relative to a fixed point, by doing some calculations:
  • The example here is perhaps a little more complicated than it needs be to demonstrate the principle, but it does a few other fun things too.
  • The adaptive component to be repeated must be set to “Shared” so it can be scheduled;  it needs to use shared parameters so they can be scheduled too.
  • In this case it is a 5 point adaptive – one for each corner of the base of a rectangle placed on each cell of the divided surface;  the fifth point works as a “Reactor” – it tracks the distance of the component from a base point.
  • This rectangle is made more interesting by having a pyramid on top that has an apex that moves depending where it is in the repeater pattern.
To create the adaptive component:
1.  Start a new generic adaptive family.
  • Place four points in a rectangular shape;  make them adaptive
  • Join the four points with reference lines (make sure 3D snapping is on)
2.  Set up the geometry for the pyramid (optional):
  • Place a point on each line  (if correctly hosted it displays as a small point)
  • For each point assign a (Shared) parameter to its “Normalised Curve Parameter” – for the notional Y axis point, make it “Y_Ratio”;  its point on the opposite side will have its “Measure From” value set to End, rather than beginning, so that they line up.
  • Assign a parameter “X_Ratio” to the notional X axis points (one from beginning, one from end, depending on which direction you drew the reference lines)

  • Join the two opposing points with reference lines
  • Place another point on one of the linking reference lines
  • Select the point and the option bar should show:
 

  • Click on “Host by Intersection”, then select the opposing reference line;  it should move to the intersection of the reference lines
  • Set the “Show Reference Planes” property of the point to Always.
  • Set the work plane to the horizontal plane of the hosted intersection point (it only shows as a single line)
  • Place another point on top of the one on the intersection (ensure 3D snapping is on);  ignore the error message about duplicate points;
  • Select the new point and drag it up in the zed axis – its ”Offset” property should change.  If you are lucky, it should be a positive value (if it is zero, then the workplane or hosting went wrong);
  • Assign a “Height” parameter to it – if it was a negative value you’ll need to assign an interim parameter then convert it to positive with a formula, for the end user to understand.
  • This point becomes the apex of the pyramid;  
  • Join the point to the four corners of the base with four reference lines;
  • Flex the X_Ratio and Y_Ratio and Height parameters
  • Create a Form (surface) on each of the four sides of the pyramid
3.  Setting up the “Reactor” controls (Important):
  • Place a fifth adaptive point to the left of point 1 (bottom left corner of rectangle)
  • Use a reference line to join it to point 1
  • Join points 5 and 4 (Bottom right corner of rectangle) with another reference line – to create a triangle of lines.
  • Place 3 dimensions between the adaptive points 5 & 1, 1 &4, 4 & 5 – for each one make sure to set the relevant reference line as the work plane for the dimension;  it is vital to snap the dimensions to the adaptive points, rather than to line ends, surface corners etc (if not then you can’t use the dimensions later on in formulas)
  • Make each dimension as a reporting instance parameter, for use in the “cosine law” in trigonometry.  We need to calculate the angle in the triangle
  • The Cosine Law for calculating an angle when 3 sides are known, is:
    Angle γ = Arcos( (A² + B² - C²) / 2AB)
  • Revit version of Cosines formula:
    Angle γ = Acos( (A^2 + B^2 - C^2) / 2*A*B)


  • To work out the X and Y components of the distance “A” between points 5 and 1, use trigonometry:

  • This calculation assumes that the angle of the line between P1 and P4 is orthogonal – so it only works with a rectangular repeater pattern.
4.  Calculation of column and row numbers:
  • This requires knowledge of how many rows/columns there will be in the repeater, and the overall size of the repeater


  • Parameters for these need to be built in to the component as shared parameters (for scheduling), as shown below;  these can subsequently be linked to the parent family parameters for these values.
    X Number and Y Number should be integers (count of repeats in each direction)
    Column Number and Row Number should also be integers.
    X Ratio and Y Ratio should be number parameters
  • You may need a couple of checks to take care of when it has zero values for the distances.

5.  Creation of the repeater:
  • The pyramid family needs to be loaded into another family that can support a divided surface – this could be an adaptive component, a mass family or an in-place mass family in a project.  In this example it will be an in-place mass family.
  • Load the pyramid into the project
  • Start an in-place mass family
  • Draw a rectangle of reference lines,
  • Give the rectangle dimension parameters of Length and Width
  • Generate a form (surface) from the lines
  • Select the surface and Divide Surface 
  • Make the nodes visible on the surface (Surface representation)
  • Assign parameters to U Number and V Number on the surface
  • Place a point just to the left of the bottom left corner of the surface – this will become the control point for measuring distance.  It is important for getting the “Reactor” effect working.
  • Place an instance of the pyramid component by snapping the first four placement points onto four adjacent nodes in the same order as you originally created the adaptive points (say clockwise);  place the fifth point on the external point – it is vital that it does not go onto a node of the surface

  • Link 4 parameters to equivalent parent parameters:
    Y_Number to     V Number
    X_Number to     U Number
    TotalX  to  Length
    TotalY  to  Width
  • Hide the nodes on the surface (Using Surface Representation - they cannot be controlled by any view settings)
  • Select the free control point and move it very close to the bottom left corner of the surface.
  • Select the Pyramid and turn it into a repeater 
  • All being well, the pyramid will array itself over the whole surface, but each instance will look slightly different as the apex point is changed depending on its distance from the control point in the bottom left corner.  If not, it could be caused by a problem with the component itself, or else the fifth adaptive point might be hosted on the same point as adaptive point one, in which case it would move with it.
  • Select (tab) any one of the pyramids;  it should display properties including its correct column and row number

  • Finish the in-place mass family
6.  Create a generic Schedule:
  • Add the column and row numbers, and any other parameters you require
  • You will be able to edit the values for Comments and Mark, but no other instance values
  • If you edit the mass family, it allows you to manually select any of the components in the repeater.  Then you can set it to “No Component” or to any other 5 point adaptive component.
When you edit the mass family, the schedule temporarily goes blank.  Sadly this means that it is not possible to drive the geometry from the schedule.  However, it does make it easier to identify and label components in a schedule – useful for adding and editing Mark values to match column and row numbers.

This technique will not work with a curved surface because it all works by calculating the actual distance from the control point to the BL corner of the pyramid and relating that to the overall length of the surface.  It will only work on an orthogonal divided surface, unless you are a mathematical genius and can write formulas to handle more complex geometry!

Saturday, 14 September 2013

How to Indent a Revit Repeater on a Divided Surface

In a recent post by Andy Milburn over on Shades of Grey, he mentioned that it is not possible to indent the edges of a divided surface.  Well, that is absolutely true - Divided surfaces are unlike divided paths, which have an indent setting so that you can push the start or end nodes of the path in from ends of the underlying path.
Divided Path indent settings

The implication of this is that when you use a divided surface to generate a "Repeater" in Revit, the repeated adaptive components will overhang the edge of the divided surface.   In the example below, a one point adaptive component is placed on a node of the divided surface, then repeated - since the adaptive component consists of a cylindrical extrusion centred on the point, it is repeated to all nodes of the divided surface.



Since you cannot indent the edges of a divided surface, how can you prevent the repeater overhanging the divided surface?  If you made the extrusion offset from the adaptive placement point you could make it indent on one or two sides of the divided surface, but then it would overhang even more on the other sides.

However, in Revit there is usually a way to achieve what you want, so I attempted to find a way to indent the repeater, if not the nodes of a divided surface:

How to Indent a Repeater Pattern

You have to use some tricky thinking, and control where the repeater components will land - and prevent it from placing any part of the extrusion in the adaptive component on the edge nodes.
One way to do this would be to create a four point adaptive component:
  • First create a new adaptive component and place four points in a square arrangement
  • Make the points adaptive
  • Join the four points with four reference lines
Now you need to set out a centre point to host the geometry so that it remains centred whatever the arrangement of placement of points
  • Place four more points on the mid-point of each reference line (watch for the triangular snap symbol
  • Join those four points with two more reference lines
  • Place yet another point on one of the central lines
  • When you select the point, it will have an option (on the Option Bar, no less) to host it by intersection
  • Select that option, then pick the other central reference line
  • It will move the point to the central intersection.
  • NB. On reflection, you could skip the last four stages and just have one central linking reference line with a single point on its mid-point.  However, you could this intersection technique for other situations - perhaps if your extruded geometry needs to be more complex than a cylinder (see later on).
  • Select the central point and set its "Show Reference Planes" to "Always"
 

  • Set the active Work Plane to the horizontal reference plane of the central point
  • Place a reference circle centred on the point (assuming you want a cylinder)
  • Give its radius a parameter
  •  Select the circle and "Create Form"
  •  Select the top facet of the cylinder and give its Positive Offset a parameter called "Height"
  • Save and load the family into wherever your divided surface resides
  • Place one of the components onto four adjacent nodes of the divided surface in the same order that they are numbered in the family (its good practice to always use the same convention - say clockwise, unlike the diagrams shown here!!)
  • Select the adaptive component and click on the "Repeater" command (its the Array icons, but with the letter P on it)
  • If you snapped to the nodes correctly it should create a regular pattern
  • The extruded cylinders will be inset from the edge - however, they will only be inset by half the distance between nodes
  • If you want the cylinders to be inset by the full distance between nodes, you'll need to be more tricky:
  • Delete the repeater (you cannot dissolve it or alter its layout)
  • Place a new component on alternate nodes in a square pattern
  • The cylinder should then sit exactly over a node
  • Select the component and "Repeat" it
  • The pattern should spread over alternate nodes on the divided surface
  • The spacing will then most likely be too big
  • Select the divided surface and double the number of divisions (or half the spacing if it is set by distance)
  • Oops - we've now ended up with the same indent as before, so we may need to try another trick
  • The answer here is to coerce Revit into doing what you want by indenting the initial placement of the component 
  • Make sure that the first placement node you select is one node in from both edges
  • Select the component and repeat it
  • This will only work if the number of divisions is equal;  it will probably no longer work if you start playing around with number of divisions after repeating the component - so it pays to set the number of divisions correctly to start with.

If you want to be really clever, you could go back to the original four point adaptive component and give it some reporting parameters and use them to drive the cylinder size depending on the divided node spacing

Sunday, 1 September 2013

RTC Europe - Fractal Fun with Revit Repeaters and Adaptive Components

On 27th September 2013 I will be presenting at the Revit Technology Conference in Delft in the Netherlands.

The topic of my presentation will be:
"Fractal Fun with Revit Repeaters and Adaptive Components" - this will be a new, improved version of the presentations that I gave at RTC in Auckland and Vancouver earlier this year.  Yes, RTC is so good that I'll be attending at all three venues this year.


As part of the presentation, all being well, I intend to give a live demonstration of how to build a fully parametric Revit model of the roof structure shown below - within about 30 minutes.  This is the Gare do Oriente in lisbon, designed by Santiago Calatrava.

Based on feedback I received from RTC in Vancouver, I have updated the handouts to reflect changes made to the modeling process that I will demonstrate.  For anyone who downloaded my presentation from the earlier RTC events, you might like to get an udated version from RTC Europe.

Gare do Oriente, Lisbon by Santiago Calatrava

Every single Revit Technology Conference has been really fantastic, and I have learned new things every time - usually they have saved me more time than the hours I spent there.  I have been able to go back to the office and quickly solve problems that have had me stumped before, or implement new techniques.

Wednesday, 14 August 2013

Mona Lisa's Eyes Follow the Revit Camera Wherever it Goes

Using Adaptive Components to make Mona Lisa's whole face follow you around the room


Have you ever wanted to make all your 2.5d trees or people face the camera in a perspective view in Revit?  No?  Well I'm going to tell you how anyway - maybe it will help someone come up with new ideas of how to use this technique.

  • First create a new "Generic Adaptive Model" family;
  • Place two points along the X axis;
  • Select the points and make them adaptive;
  • Join the points with a reference line;

  • Set the workplane to be the vertical plane of the adaptive point (1) at the start of the reference lin, perpendicular to the line;

  • Alternatively you can pick the end workplane of the reference line itself;
  • Use model (or reference) lines to trace the 2d outline of a person;
  • Select the lines and create a form - an extrusion of the person outline;
 
  •  Select adaptive point 2, move it around to flex the family;
  • The person extrusion should remain perpendicular to the line, and it should rotate around to follow it (providing it was correctly associated with the work plane of point 1;
 

  • Return the adaptive points to the x axis location;
  • Add some model line detail (or more extrusions as desired), making sure that they are either hosted on the same workplane or on the form itself - in this case I have added a Mona Lisa face to make it more fun;
  • Flex the family again by moving adaptive point 2, to check that all geometry is correctly associated - in this case the face rotates but Mona Lisa's eyes will keep looking at you;

  • Now the Mona Lisa family is ready to use;
  • Load her into a project;
  • In this example I have created a series of arch doorways;
  • I have also created an object to represent the camera location - it can be any object, but the best thing would be to create a "camera family"










  • Place a Mona Lisa adaptive family - first point in the middle of an archway, second point snapping onto the camera object (important, it must snap to it)











  • Place a second Mona Lisa in the second archway, but snap its second point to the same camera object;
  • Place as many more Mona Lisas as you need, each sharing the same second point on the camera object;











  • Note how each Mona Lisa is slightly rotated, so that they are all looking at the camera object;
  • Now create a camera view, ensuring that the camera location is approximately the same as the camera object;
  • All the Mona Lisas will be facing the camera;
  • You might argue that her eyes would have been looking at the camera without rotating the whole body - true, but this technique will work for anyone other than Mona Lisa;  or for a tree or any other 2.5d (flat extrusion) entourage family;
















  • Create another camera view from a completely different angle;
  • The Mona Lisas will no longer be facing the camera in this view




















  • Check this out in plan view too - they are all still facing the first camera location;
  • Right-click on the second perspective view in the Project Browser, and select "Show Camera" to see where it is in plan;
  • Place a marker - eg a cross in plan;
  • Move the camera object to the new camera location;
  • All the Mona Lisas should rotate together to face the new camera position

This may seem like a clunky workflow, but once it is set up all it requires is a single move of the camera object to each view location - so its not going to work if you have several views on one sheet.

Of course all the people don't have to look the same - they just need two adaptive points to work.  Each person could have a parameter for a small rotational adjustment within the family to give some variation - each one could face slightly away from the camera, but close enough not to get any side on views of extrusions.  This would ensure that the scene does not look quite so artificial.

There is an alternative method of placing the people - more on that next time.

I hope this helps someone out, or inspires some new method of improving presentation methods in Revit . . . .




Thursday, 1 August 2013

Scaling Revit Families Nested in Curtain Panel Patterns

Credits First

This post would not have happened without discussions at RTC or blog posts by the following people:
What I am showing here is a development of all those ideas, combined with a concept that I came up with for my RTC presentation "Fractal Fun with Revit Repeaters" earlier this year - more on that at a later date.

How to trim the edges of a pattern of repeated scaleable Revit families

The image on the left above shows a repeated pattern of complex shapes within a regular rectangular boundary - relatively easy to achieve in Revit!  On the right the boundary has been trimmed, and the pattern gets trimmed with it - not so easy.
Add in the ability to scale the pattern elements and it gets a whole lot trickier. 

Kelvin Tam showed us how to nest a planting category family into another planting family and then nest again into a different category family - this allows us to use the ability of planting category to automatically scale any irregular shape without having to create complex formulas and controlling geometry (see link above).

David Light applied that technique to nesting planting categories into curtain wall panels to create arrays of scaleable science fiction monsters marching across the landscape.

Andy Milburn applied the same technique to creating Musharabiya screens out of curtain walls.  He noted that there was a limitation of not being able to trim the edges of the pattern because curtain wall panels won't be be cut.

To solve that problem I used Marcello Sgambelluri's technique of questioning which similar category or situation does Revit allow you to do what you want?  In this case I knew from my RTC presentation "Fractal Fun" research that Revit will cut the edges of curtain wall panel pattern families when applied to divided surfaces.  So we should be able to apply that principle here - the only limitation being that it must be done in the conceptual modelling or adaptive component environment.

Here is how to do it:
  • First start a new planting category family and create the desired pattern element within it - in this case a simple smiling face within a square (but it could be a complex geometric design).
  • Then start another new planting category family;
  • Load the first family into the second;  this is to make use of Revit's capability of automatically scaling plants and trees - it only works with nested families;
  • Start a new "Curtain Panel Pattern Based" family;
  • Place a dimension between two adjacent points; 
  • Make the dimension an instance reporting parameter 


  • Load the second planting family into it, and place it on the pattern.  You may need to devise a way to control the location of the component by hosting it on specific points
  • Select the planting family and link its "Height" parameter to the new reporting parameter in the pattern family;  you may need to add a formula to scale it up or down to match the size of the pattern grid (depending on the original family size) 
 

  • Create a new mass family or In-Place mass within a project;
  • create an irregular shaped form (can be a flat surface or an extruded shape);
  • Select a surface and divide it
  • Make sure the divided surface pattern is square and orthogonal - you may need to rotate the grid or set the spacing to fixed distance;
 
  • Load the curtain panel pattern family into the mass
  • Select the divided surface and change its type to the pattern family - it should automatically trim the pattern elements around the edges
  • NB. I think this did not work in the first version of the new conceptual massing in v2010?  but it seems to have been changed at some point since.
 
  • Depending on the grid spacing and location, Revit sometimes misses out small pieces or fails to trim elements that are hanging over the edge by only a small amount.

  • Occasionally it gets it quite wrong - in this example it was an in-place mass, which looked ok until the mass was "finished".



All this was done without tricky formulas - just by using the tools that Revit developers gave us, albeit not in ways that they expected us to use them.  There are obvious limitations of not being able to apply this to a normal curtain wall, so you have to use the massing tools to create a divided surface.

Obviously you aren't going to make smiley face patterns, but you should be able to apply these principles to real architectural design solutions.