Revit – 3D Grids

One thing I often notice when training new users on Revit is the question ‘Can I see the grids in 3D?’ to which the answer has traditionally been ‘no’!

Revit 3D Grids

Based on this I will now run through a quick tutorial to show you how to both use and create a 3D grid utilising Dynamo.  The basic idea is to select all the grids within a project, get the curves of the grid and then place 3D custom families on these points to replicate the grid. I have created the families with the correct sub categories so the grids can be switched on and off as you probably will not want to see the grids in plans and elevations.

3D Grids - Sub Categories

The Grid Head family uses 3D model text with a parameter attached to receive the actual grid reference. The grid line is modelled with an adaptive two point family with a control for the diameter.

Revit 3D Grids

If you are interested to see how everything works then take a quick look at the attached YouTube video where I run through the Dynamo Script in detail and show the various families.

Hope this helps,

LawrenceH

Revit and Dynamo – Finding the Centroid (CoG) of Revit elements

I was recently asked by a contractor if Revit could report on the centroid of selected objects to facilitate crane lifts. For those of you that know Revit well the answer if normally no. However, Dynamo is really useful for this sort of task. I have created a simple family to represent the Centroid and added three shared parameters to report on the X,Y and Z coordinates.

Centroid

As you can see from the above Dynamo graph the method is fairly simple and can be really useful for a number of scenarios in construction planning.

Here is a quick video showing the use of the Dynamo Graph.

Centroid

Revit 2017.1 & Dynamo Tutorial – Setting All Rebar Visible and Solid in View

As many of you will already know, controlling the visibility of reinforcement within Revit can be challenging and time consuming as each new rebar modelled needs to have the visibility set, for example, you create a new range of rebar and then are required to click ‘View Visibility States’ and then select the views that you wish to see the rebar unobscured and ‘as solid’.

Link to Video: https://youtu.be/BmDQ02GhtfE

revit-rebar-view-visibility

In this tutorial I will take you through the steps required to write your own app to automatically control the rebar visibility, the tutorial will use Dynamo 1.2.1 and Revit 2017. With this tutorial no external packages are required.

Here is the end result of the tutorial shown in the video clip below.

dynamo-player

  1. Open an existing model that contains a 3D view with Reinforcement and leave the 3D view active.
  2. On the Manage ribbon, click the Dynamo Icon and start a new dynamo session.
  3. Create the following nodes as shown below (Leave the Python Script Node to step 4).

revit-rebar-visibility-dynamo

I have labelled each node so you can understand how each node operates but feel free to watch the short tutorial video if you have never used Dynamo before.

4. In the Search Bar in the Node library search for Python and add the Python Script node as shown below.

python-script-node

Double Click the Python Node in the grey area as shown below to open the ‘Edit Python Script’ dialog box.

python-edit-script-node

Copy and Paste the Python Script below and Accept Changes (to Line 35).


import clr
#Import RevitAPI for Rebar Control
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference("System")
from System.Collections.Generic import List

# Import RevitNodes
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Assign Inputs and Output
rebarElements = UnwrapElement(IN[0])
views = UnwrapElement(IN[1])

#Change rebar Visibility
TransactionManager.Instance.EnsureInTransaction(doc)
for view in views:
 for rebarElement in rebarElements:
 rebarElement.SetUnobscuredInView(view,1)
 rebarElement.SetSolidInView(view,1)
TransactionManager.Instance.TransactionTaskDone()

OUT = rebarElements

Your Code should now look like the image below.

python-code
Add an additional input to the Python node as shown below and wire the Rebar elements into IN[0] and the view into IN[1]. (Note that even if you are just requiring one view it must be a list for the Python Code to run without errors.)

python-script-node-with-second-input-added

Dynamo Player (Revit 2017.1)

For those of you running Revit 2017.1 you can run this simple tool directly from the Player without having to open Dynamo, this could be very useful for people that want to use these tools without wanting to open Dynamo.

On the Manage Ribbon, select the Dynamo Player Icon as shown below.

dynamo-player-icon

The Dynamo Player will then launch, you need to select the folder icon as shown in the image below and browse to the folder that contains your .dyn files. You can then simply play the script!

dynamo-player-folder

Revit and Dynamo  – Set Rebar Unobscured and solid

AutoCAD 2D Drawings to Revit via Dynamo – The Smart Way!

Even though the majority of users are now firmly engrained with Autodesk Revit software we still have to rely on AutoCAD for things such as Architects drawings, surveys and sometimes to interface with our favourite structural analysis software not currently integrated with Revit. Rather than recreating this data we can simply reuse this by reading BIM data from AutoCAD! So what is this BIM data from AutoCAD I hear you ask! In the case of a survey you have a wealth of information that you perhaps didn’t realise. The below Revit Survey was created entirely from the AutoCAD 2D survey. Note that some of the points may be slightly inaccurate due to the position of the text but still better that no 3D survey!

revit-survey-from-autocad-2d-drawing

Let’s take a look at the example below. Here you can see a typical 2D AutoCAD drawing representing a survey. We have the levels, information relating to trees, concrete bases, survey pins as well as areas of water. Of course this information could simply be linked into a Revit model as a 2D drawing but we would be losing quite a bit of information if we took this approach.

autocad-2d-survey

If you LIST or review the Properties of an AutoCAD object in a drawing such as a tree this is quite likely to be a Block. The block often contains attributes that we can utilise in Revit as BIM data. In the below example I have selected a tree. The Properties that I have highlighted are going to be used to recreate these trees. Notice that the canopy dimensions are controlled by the Scale; this is a fairly common practice.

autocad-block-and-attribute-properties

I have then typed the command EATTEXT (Enhanced Attribute Extraction) which will allow the end user to select the relevant properties and attribute values and write these out as a Microsoft Excel file.

Here is the Dialog that allows the selection of an entity or block. In this case I am extracting the block , PTS-047 which are the trees

eattext-page-3

I then select the relevant information that I require. In this case the Position (X,Y) and the scale (This is the canopy diameter) and the attributes.

eattext-page-4-selecting-required-properties

Here is the preview of the data prior to saving as a Microsoft Excel file. In this dialog you can drag the columns to new positions and suppress items such as name and count.

eattext-page-5

The data is now written to the Microsoft Excel file so that Revit and Dynamo can read this data and create the relevant objects.

autocad-extracted-data

In a similar way you can extract the text for the Level data and build a topographic surface in Revit. In the below image you can see the insertion point of the text as well as the Contents which will become the Z level. The trees are then placed as families which will automatically ‘sit’ on top of the topography.

properties-of-the-text-level

Here is the Dynamo Script to get the Topographic points from AutoCAD and create topography in Revit. It is worth noting that for those of you that have access to AutoCAD Civil 3D this can be achieved automatically. Note that I have split the image into two so that I could fit it on the screen!

dynamo-script-for-2d-levels-to-topography-part1

dynamo-script-for-2d-levels-to-topography-part2

Here is the resulting Topographic surface in Revit.

revit-topo

And here is the finished Topo with trees, slabs and sub regions imported.

revit-survey-from-autocad-2d-drawing

This workflow can be used for all manner of tasks. I do plan to create a full video tutorial if there is enough interest from the community?

Hope this is interesting,

LawrenceH

Revit Reinforcement – Keeping a check on Bar Marks

Since 2015 Revit has provided the Rebar Number which automatically assigns bar marks to all reinforcing within the project making use of the partitions to generate a suitable bar mark.

revit-reinforcement-number-and-partition

This is of course a very useful feature and does provide an efficient method of bar marking. However, if you have then issued the model and need to make further changes to the model then you probably do not want the Rebar Numbers (Bar Marks) to change and of course, being automated this can happen.

A safe way of working is to use Dynamo to automatically synchronise the Rebar Number to the Schedule Mark (this was the method of bar marking prior to Revit 2015). This will obviously only be run prior to the issue of the drawings/model to keep a record of the bar marks.

If the Rebar Number does not equal the Schedule mark then we can take ‘manual’ control to rectify the problems.

Here is my Dynamo Script below.

dynamo-sync-rebar-number-to-schedule-mark

It is a very simple routine that selects all the Structural Rebar in the project, gets the Rebar Number and then sets the parameter Schedule Mark with this value.

The next stage is to check that the marks are in synchronisation. To check for this we can use another Dynamo script. For this example I will explain a few stages as we need to use some logical checks and filtering of lists.

The first stage is to create a new shared parameter for the check. This needs to be a Yes/No parameter as shown below.

barmarksync-shared-parameter

Next we will add this parameter to the project so Revit understands which category this applies. Notice that the parameter will need to be an Instance and applied to the Structural Rebar Category (Feel free to add others such as fabric etc.)

barmarkcheck-project-parameter

You can now build the Dynamo Definition to check the Rebar number and schedule mark are in synchronisation. Start by selecting all the Structural Rebar elements as shown below.

rebarsync1

The next step gets the Schedule Mark and the Rebar Number and then checks to see if these values are equal. The output is a Boolean (true or false). Notice that one of these values is returning a false value.

rebarsync2

The true or false lists are then evaluated by the List>filterByBoolMask. The list input is from all the Structural Rebar Elements and the mask is the Boolean output from the == node. The list is then split into two, one list for false and another for true. Finally the parameter “BarMarkSync” is then set to true or false with the use of the Boolean node.

rebarsync3

To test this you can manually set some of the Schedule Marks to different values and then set up a Revit schedule to show the out of sync marks with conditional formatting as shown below. Another method could be to use filters to show the out of sync bar marks on a model view.

schedule-conditional-format

I hope some of you will try this tutorial if you are currently using Revit to produce Reinforcement  models and schedules.

LawrenceH.

Revit Structure & Dynamo – Piled Wall Systems Tutorial

When creating Piled wall systems within Revit you either have to create a structural wall and then 2D detail this in plan to look like a piled wall system or more commonly place each male and female pile and at best, use the array or copy commands. Although this is not too complex for linear piling it can get quite time consuming when curves and turns are encountered within the path.

Link to video: https://youtu.be/EWsMnTbkIWE

Piled wall systems with Revit and Dynamo

Dynamo does provide a very neat solution to this problem and could also be used for sheet piling as well as secant and contiguous systems. In this example I have created a chain of model lines which represents the path of the piling in plan. I then project these lines onto the surface which gives the correct Z levels. The path is then divided into segments and each coordinate pair is then extracted from this list. Finally an adaptive component is placed at each set of coordinates.

This tutorial starts with a quick look at the anatomy of an adaptive component. Adaptive components are very useful when you need to control the placement of elements along a path and have the element rotate to stay aligned. A good example of this is sheet piling.Revit Sheet Piling - Connected clasps

The Adaptive Sheet Pile is basically a standard foundation family that is nested into an adaptive component template. The below image shows the nested family and the adaptive points that control the placement of the pile.Adaptive Component

The first stage is to create a path for you piling layout, in this example I have done this with Model lines. Start Dynamo and then create a new workspace.
The first section of the dynamo graph will allow the user to create a selection of model lines. The Element Curves node will get all the curves/lines within the selections. The list is then flattened and the individual curves/lines are joined into a single poly curve. The last node reports on the total curve length.Sheet Piling with Dynamo - Select model elements

The next stage is to get a selection of your topography and then convert this into a poly surface. The node I have used below if the Python implementation which is much faster than the original conversion tool. (This is found in the Spring Nodes package).

You can then take the surface and the joined curve from the top example and then project this onto the poly surface (Your Topograpghy). Note that the Vector.ZAxis simply projects down the Z axis.Sheet Piling with Dynamo - Get topo

The graph should now look similar to the below image.

Sheet Piling with Dynamo - first part of graph

We now take the new poly curve and divide this into a series of points. In my case the sheet pile in 900mm from point to point. I want to have a start and end point for each pile so I am simply going to divide this by 2.

Sheet Piling with Dynamo - Code Blocks

I have now created a Code Block to divide the curve length into the half distance of my sheet pile.Sheet Piling with Dynamo - Create the Divisions

This will of course create a real number (65.4950), what we need is to round this value down to the nearest integer (65). The output of this is then used to divide the curve into the required number of points. The output of the Points node now contains all the coordinates.

Sheet Piling with Dynamo - create the division Points

These coordinates need to be split into pairs. The List.Chop will then create pairs but if there is a single coordinate left then the Adaptive Component will fail to be placed. The filter looks at the length of the sub lists and then only gets the lists that have more than one set of coordinates.Sheet Piling with Dynamo - Split into Pairs

This is more of a high level overview of the process and the Dynamo script but I will do a video showing and explaining each stage.

LawrenceH