Sunday, 22 January 2017

Using Totals in Formulas in Revit Schedules

This has been a frequently asked question on the various forums over the years:
"Is it possible to use a grand total from a schedule in a formula in Revit".  The first response is always No!  Then eventually someone will mention the arcane workaround but it is not always clearly explained so I have decided to show a simple example of what the problem is, and how the workaround might be applied.

I must confess that this is not my original idea - in fact I have found references to the workaround, as far back as 2006 on AUGI by Leonard Raiz (one of the Revit Founders).  More recently (2011), Martijn de Riet published a description of how to calculate a ratio between two area types - this includes the workaround but does a few extra tricks of calculating a ratio of two different sub-totals after first separating them from one grand total, so it is not that easy to understand just the 'totals in formulas' workaround.  Many thanks to Martijn, as I originally learnt the technique from his blog posting.


The Problem With Schedule Totals

Let us suppose that you want to schedule a series of floor areas for a multistorey building and then calculate the ratio between the total of those floor areas against the site area - in Australia we call that the 'Floor Space Ratio'.  There are actually two problems that Revit presents us with here:
  • Revit apparently does not allow you to insert a total of several values into a formula- it only performs the calculations on individual values in each row
  • You can't create a schedule that combines 'Areas' and 'Property Line Areas' because they are different categories - this is another topic so we'll use another quick workaround to deal with that here.
In this example I will use Mass Floor Areas, but they could easily be normal Areas

The Floor Space Ratio calculation is defined as:   'Gross Floor Area' divided by 'Site Area'
It is usually represented as the 'number : 1'   eg. 2.5 : 1

Step 1

  • The first step is to create a Mass Floor schedule, and add the Levels plus Floor Areas
 
  • The first problem we encounter is that you cannot combine a Mass Floor schedule with Site category schedules - so you cannot include the site area value that Revit automatically calculates from your property lines

Workaround 1

  • Create a shared parameter and apply it to the Project Information category
  • This will be a value that you have to type in to the project information page once - and update it if the site area changes, which is obviously a technique prone to user error.  If your site area is not yet settled, and is constantly changing, I would not recommend this method.
  • Once the value is in, you can add the shared parameter to your schedule just by changing the category from the drop-down list and choosing Project Information
 
  • The same value for Site Area will appear in each row, so make sure not to calculate totals for this parameter.
 

Step 2

  • Add a calculated parameter to the schedule, called 'Calc Ratio' (or some such) 
  • Make it a 'Number' type with this formula:
    Floor Area / Site Area
  • Note that each row has its own calculation of the ratio - none of which is correct.
  • If you make the parameter 'Calculate Totals', the Grand Total value of the Ratio will actually be correct - but it makes for a very confusing schedule
  • You could of course collapse the schedule down to one line (untick 'Itemise Every Instance'), and hide the totals - this would display the correct Ratio - but you may require the schedule to show individual floor areas
 
However, there is a way to get Revit to display all the rows of data and to perform calculations on the total value - it requires the following workaround:

Workaround 2

  • In the schedule, add a new calculated parameter called 'F Area Percentage'
  • This time, make it a percentage calculation - click on the 'Percentage' radio button
  • Then select 'Floor Area' as the parameter to calculate 'Of'
  • Leave it to calculate 'By' Grand Total
  • This will list each floor area as a percentage of the total
  • Create another new calculated parameter, called 'Total Floor Area'
  • leave it as a Formula calculation, with type 'Area'
  • Add the Formula:
    Floor Area / F Area Percentage
  • This will give you the correct overall floor area in each row 
  • Be sure not to calculate totals for this parameter.
 
  • Now change the Ratio formula to calculate using the Total Floor Area:
    Total Floor Area / Site Area
  • This will give the correct ratio in each row
  • Remove the Calculate Totals setting for this parameter as the total would be a crazy value

  • You can then hide the two intermediate calculations (Total Floor Area and F Area Percentage) to get a schedule showing the correct site area, floor area and ratio in every row
 

Tidy Up

  • To make the schedule read a little more cleanly, you could sort it by Site Area, with a Header, and then hide the Site Area parameter column - but it only shows the value of the Site Area, not its parameter title, which is not clear enough

  • Then add another Calculated Parameter at the beginning - a text type with a formula:
    "Site Area :"
  • Sort by that parameter before the Site Area, and hide that one too
  • It puts them on two different lines but at least it removes some repetitive information from the body of the schedule
 
 
  • You could try the same with the Floor Space Ratio but unfortunately Revit does not like to sort a schedule by such a formula  - it does not show in the Sort by or Filter list (a bug perhaps? or just a special feature?)
  • You could also put in a few extra text formulas (with blank headings), although they will repeat the same information

Workaround 3

If you can cope with two schedules, it is a lot easier: a simple one liner schedule for the Floor Space ratio calculation, plus a separate schedule list of all the floor areas.
  • You can either create two similar schedules as described above, but collapse one of them down to one line (untick 'Itemise every instance'), and remove the calculations from the full list.
    or
  • Revit makes it simpler to do this operation on Mass Floor areas because you can just create a Mass schedule (as opposed to Mass Floors) that already has a property called 'Gross Floor Area', in which it automatically calculates the total of the Mass Floors - thus you can do a direct calculation on it


I hope this explains the technique clearly.  If you want something more complex, then refer to Martijn de Riet's blog posting on how to calculate a ratio between two area types

Thursday, 12 January 2017

Underline Revit Schedule Headings

I was recently asked if it is possible to just underline the Revit schedule column titles without having all the lines/boxes below.  At first I thought it was not possible, so I figured out a crazy workaround.  As I was checking the workflow for documenting it on this blog I discovered something I didn't know (or at least had forgotten but once knew), which made the solution quite easy.  I have always found that preparing conference presentations is a great way of learning a subject thoroughly - instead of thinking that you know it all.  It seems that writing a blog has the same benefit.

I decided to document the workaround here anyway because someone might learn something in the process, or be able to use it for some other purpose.  If you just want to know the best solution, skip to 'The Correct Workflow'

Underline Workaround Method

When you first place a schedule on a sheet, you get some pretty uninspiring looking graphics - all boxed in, with the heading text centre justified and the body text left justified.
Default schedule appearance
If you look at the schedule 'Appearance' properties, the default settings show Grid lines on, Outlines off.  Depending on your project template, you may have the same text type for all three aspects of the schedule text - in which case it is wise to create separate text types for title, header and body text, making sure they are named clearly.
Default schedule appearance settings
 You could try turning on the Outline and hiding the gridlines to see if it underlines the title/header.
Outline on, gridlines off
Unfortunately it does not underline either the title or headers - those settings are very crude, giving us very little control at all.  The end result is a box around the whole schedule.
Outline on, gridlines off
The next thing to try is to switch off the outline box, then underline the header text itself.  You could select the header text in the schedule view, and change its font properties
Selected text font properties
However, it is much better practise to use a specific text type for the header and edit the type properties for it - so you can change them all at once without having to select the text in the schedule cells.
Text type properties
The end result is that individual header text words are underlined, which looks awful - we are trying to get one single line under the whole lot.
Header text underlined
How about using the schedule formatting tools introduced in Revit 2014?
  • First edit the Schedule Header text type to remove the underline.
  • Then highlight all the header cells by dragging the cursor across them - this has to be done in Schedule edit mode, not in sheet view.

Select all the header text cells
  •  Click on the Borders icon on the ribbon.
  • This opens the Edit Borders dialog box
  • Select the linestyle you want the underline to be
  • Click on the border box to the lower left with cells underlined
  • Click OK
  • Assuming that you switched off the 'Gridlines' and 'Outline' checkboxes, you still won't see the borders on the header cells (or any borders at all).
  • Enable the 'Gridlines' checkbox, and you get all the gridlines back again (not just the header underline borders.
  • This was the point at which a gap in my knowledge caught me out, so I devised the crazy workaround.  I thought that you could not control the borders on individual cells in the body of the schedule because the Borders icon was greyed out as soon as you select one or more cells - more on that later.

Crazy Workaround

Don't follow these steps!
  • First I created a white coloured linestyle
  • Then set the linestyle for 'Gridlines' to be the white linestyle
  • For this to work it requires the 'Blank row before data' checkbox to be ticked
White line gridlines plus blank row before data
  • Hey presto - the gridlines are there, but you can't see them as they are white on a white screen (of course it won't work if you changed your background colour).
  • The header cells should be underlined because those cells had a black border

The Correct Workflow

This is how you should do it - so much simpler:
  • Set the gridlines linestyle back to something sensible like 'Thin Lines', making sure that 'Gridlines' is ticked
  • What I didn't realise earlier is that you can modify the border lines on all the cells by selecting the columns at the top of the schedule, by clicking on the letters at the top - just like Excel.  Duh!
  • Select all the columns by running the cursor along the row of letters
Select all columns
  •  Click on the Borders icon on the ribbon
  • Click on the 'None' icon
None borders on all cells
  •  Select the Title cell and set its cell borders to None
  • Select just the header cells
Select all the header text cells
  • Click on the Borders icon on the ribbon
  •  Select the linestyle you want the underline to be
  • Click on the border box to the lower left with cells underlined
Underline border
  • Make sure that 'Blank row before data' is ticked otherwise the Header cell underline borders will not show - this is the useful tip I discovered in my crazy workaround that also applies to this method
Grid in headers/footers/spacers
  • Also untick the 'Grid in headers/footers/spacers' checkbox otherwise you'll get vertical gridlines in the blank row (as above)
Appearance formatting
  • Select each column and change its horizontal alignment as you require
Align columns
  • Finally you should get the desired result
Underlined headers
  • If you want to have some fun you can shade alternate columns.  I don't believe there is a way to shade alternate rows, which is something people do in Excel occasionally.
Alternate columns shaded

The moral of this tale is that we now have two different ways of controlling the gridlines on Revit schedules - they do not work well together.  Basically you can opt not use the old controls unless you want very simple formatting that happens to match the old options (All gridlines or just an outline box).  If you want to use the new border tools then you need to make sure the old gridline checkboxes are set to the default settings (as shown above).

Tuesday, 3 January 2017

Separating Model and Detail Lines in Revit - part 3

Previously I posted descriptions of how to distinguish between model and detail lines in Revit and part 2 - using View Display Model .   These various methods demonstrate how to visually distinguish between model and detail lines - but not how to just select one or the other.  As previously described, you cannot use the Revit selection filter to separate the lines - it does not distinguish between model and detail lines, although it does separate by family type.

Revit selection filter

Add-Ins for separating model/detail lines

The solution to this is to use a Revit Add-In product.  My favourite is 'Ideate Explorer', which is robust and fairly comprehensive:
'Explorer' is a tool for model-management and auditing Revit projects - but is also very useful for finding objects, be they hidden or just not easy to identify using standard Revit tools.  One of the things it does is clearly separate model and detail lines in a selection, active view or even the whole project.
Filter by current selection

Select by Active View or Entire Project

Once you have narrowed down the filter to just the detail lines (if that is what you want), they are now selected so that you can now deal with them.  In the example below, detail lines have been used to indicate a floor penetration, which is a serious Revit misdemeanour!  They need to be replaced by a 'Shaft Opening' object.  However, that would mean recreating the dimensions - so if your drawing needs to be issued in the next 5 minutes, the least you could do is convert the lines to model lines using the 'Convert Lines' tool.


QuickSelect

Ideate Explorer is somewhat overkill for such a simple task, so from this year you can now use a sort of cut-down version called 'Ideate QuickSelect' - this just allows you to select or filter specific items in a similar fashion (by current selection, active view or whole project), without having any capability to further analyse the elements.
Ideate QuickSelect

These tools are great for finding other things that should not be in your model such as images or imported DWG files that have been placed and hidden on views - Explorer tells you which views they are on.  In that situation, when a view containing hidden items is duplicated with detailing, the hidden items are duplicated too, and remain hidden, which can rapidly lead to project file-size bloat.  One improvement to 'Explorer' would be to display the file size of imported DWGs and images.

Friday, 16 December 2016

Applying colours and Materials in Rhino for Revit Import

Following on from my previous post about importing Rhino materials in Revit 2017.1   here is a brief description on how to set up the colours/materials in Rhino:

I am new to using Rhino, so my understanding of the UI and functions is pretty basic but I managed to figure out how to apply colours and materials to objects without reading any manuals.  I am happy to be corrected if there are better ways to do this.

Once you have created an object (or multiple objects), you can select the object and view its properties.  Unless you tell it otherwise, it will be on the 'Default' layer, with Color, Linetype etc set to 'By Layer', which means that it will behave according to the layer settings.  During the new import process, Revit 2017.1 considers the default layer & colour not to be a material.
 

You can change the layer of the object from the Layer drop-down list, providing you have created new layers

By default, your file most likely will have no layers, so you need to create them, using the 'Edit Layer' function, available from the Edit menu.

Once the layers menu has been opened, it will be available under a Layers tab.  It has typical columns showing the name, show/hide, lock, display colour (just a box) and material properties for each layer.  New layers will have default settings (no colour or material defined), but these can be changed by clicking on the colour box or adjacent space under the material column.
If you are creating layers just to manage export to Revit, the names are irrelevant to Revit, but the colour and material are important - you don't need to get the colour/material right for its end use in Revit, as long as each object has a different colour, it will become a different material when imported to Revit.  The materials can then be edited in Revit.

If you expand the width of the menu it shows the material name (if defined), linetype and print width/colour - the print colour does not seem to be relevant for Revit imports.

Materials

You can define a material for use in Rhino, but the only thing that Revit takes note of is the material colour.
Rhino Material Properties

Object Properties

Normally, objects will display according the the 'By Layer' settings, which means that all objects on a given layer can have their properties changed together easily.
Object properties By Layer

You can override individual 'Display Color' for any selected object
Object properties By Object
If you choose a non-standard colour, it will show the colour name as 'Other'


SAT files

I tried exporting a coloured Rhino file to SAT format, then importing it to Revit, but sadly it did not bring the colours in as materials - so I am not sure what the trick is to assigning colours to objects in a SAT file.  I tested various ACIS versions of SAT format, to no avail.
Rhino Export SAT options
Does anyone know how to define colours for objects in a SAT file from Rhino?  Or from any other 3D modelling software?

Import Colours to Revit

For details on how these colours are imported to Revit, refer to importing Rhino materials in Revit 2017.1

  • It seems that Revit uses the display colours set in Rhino, not the print colours.
  • If you import two different Rhino files that have identical colour definitions, it treats them as different materials
  • If you import the same Rhino file twice, it seems that Revit assigns the same materials to objects in both instances
  • However, if you rename a material, or change its definition before importing the second instance, Revit will create new materials with a suffix of (2) added to the original name.  You could use this to your advantage if you want multiple instances of the same object but with different materials.