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

Advertisements
Posted in Tips and Tricks | Tagged , , , , | 6 Comments

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

Posted in Tutorials | Tagged , , , , , , | 9 Comments

Autodesk Revit to Autodesk Robot Structural Analysis – Send Options

Happy New Year and look forward to all the good things planned for 2017! A few Autodesk Revit Releases back (Revit Structure 2015), Autodesk made a change to the integration with Autodesk Robot Structural Analysis to allow the transfer of data via an Intermediate .smxx file (Structural Binary file for transfer). Whilst this new format offers some benefits, the older method did have a few additional features that have not been incorporated within the .smxx export.revit-to-robot

The most useful of these were around offsetting structural members and the use of System panels and mullions.

Here is the process of transferring offsets in Revit to offsets in Autodesk Robot Structural Analysis. The beams have a z Offset Value of -50 set in the Properties Palette.

structural-framing-offset

When the model is ready to be transferred to Robot Structural Analysis, hold down the Ctrl Key whilst clicking the Robot Structural Analysis Link command. You can then click the Send Options and select the ‘Use drawing model offsets as analytical’ check box.

revit-to-robot-options

Here is the result in Robot Structural Analysis.

robot-structural-analysis-offsets

Some of these legacy features can be useful so the Ctrl Key can revert back to the legacy method. Please be aware that results cannot be transferred to Revit using the ‘old’ method.

Hope this helps,

LawrenceH

Posted in Tips and Tricks | Tagged , , , | 2 Comments

Happy Holidays!

I hope you all enjoy the holidays. Here is a nice winter image of a reindeer created in Revit and Dynamo. The structure has been made with CHS self illuminating sections!

dynamo-raindeer

Posted in Uncategorized | Tagged , , | 1 Comment

Revit 2017 Reinforcement Tag Alignment

Whilst providing Reinforcement Detailing training I often get asked if it is possible to align the  MRA (Multi Rebar Annotation) tags. Currently with Revit 2017 it is not possible to align the tags but I recently stumbled over a free application to achieve this task!

autodesk-revit-mra-reinforcment-range-indicators

The application can be installed via the Autodesk Exchange Apps website by clicking the ‘X’ icon on the InfoCenter toolbar in the top right corner of Autodesk Revit.

autodesk-revit-exchange-apps-icon

You will now see the Autodesk App Store web page. Search for Align and then install the app from BIM 42 as shown below. (The app currently supports Revit 2016 and 2017)

BIM 42 Align Tool.png

Once the app is installed you can access the tools by selecting the Add-Ins ribbon. The tools are shown on the Align panel as shown below.

align-ribbon-panel

Here is the result of using the Align Left tool with a selection of MRA tags.

rc-tags-aligned

Overall this is a very useful set of tools for any tags that you may want to tidy up. See the GIF video below.

reinforcement-tag-align

Posted in Uncategorized | Tagged , , , , | 5 Comments

Revit 2017.1 – What’s new for Structures

Yet again it is time for the mid-year update to Revit 2017, this year Autodesk have changed the naming of the update to a point release which makes a lot more sense to most users. Previous releases have been marked as R2 which could also have a file format change which can cause issues when working on collaborative projects requiring a consistent platform. This release does not change the file format and also incorporates Service Pack 1 and 2.revit-2017-1-on-the-application-bar

Dynamo Player

The Dynamo Player has been created to create a simple interface for end users to run Dynamo scripts with a project or family file. The Dynamo Player can be pointed to a server location where dynamo scripts can then be selected and executed with a single click.dynamo-player-revit-ribbon

Currently the Dynamo Script must be a stand-alone utility that can be run with no inputs required from the end user which is quite limiting. For example, if you are required to enter a dimension or pick an entity then this is currently not possible.

Below you can see the Dynamo Player displaying the Dynamo (.dyn) files in the selected folder. The user then simply selects the play icon to run the script.dynamo-player-running-script

This is obviously the first iteration of Dynamo Player concept and I am sure as this develops that an Interface will be created for adding inputs into the dynamo script. For example, Autodesk FormIt will allow interaction with Dynamo to create conceptual forms. Slider bars and input boxes are created to enable an interactive environment.

Below is an example of the Dynamo Customizer to publish a script to a web page. This is perhaps what Dynamo Player may look like in future releases.dynamo-interface

A small structural enhancement is the ability to split structural framing and structural columns with the conventional split command and retain setting out positions of openings. Previously the openings may have shifted position.

In the below example the beam has been split and the circular openings have retained setting out positions. The same is true for the structural column.connections-with-splits

Import Rhino/Sat Files

rhino5-chair

Revit 2017.1 now has the ability to directly import a Rhino (.3dm) file into either a Revit Project or a Revit Family. You can also assign a category to the import but there are limitations. Below is the amended Import CAD format dialog box showing the direct 3dm import and category selection.rhino-3dm-import

The imported object cannot be re scaled in Revit so you can only import objects of the correct scale. The import cannot be partially exploded to remove small/unwanted details.

On both my test models some of the elements did not import.chair-in-revit-with-missing-crossbar

This is a nice addition and will improve but in my opinion Dynamo is still the best method at present to import and work with native Rhino geometry.

Some other additions are platform for the repair of Central Files. I have not tested this at present but will update the post when I have some test results.

In summery the point release has not had as much new functionality as previous releases and perhaps should be seen as more of a service pack.

Hope this has been useful,

LawrenceH

Posted in Uncategorized | Tagged , , , , , | 3 Comments

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

Posted in Tutorials | Tagged , , , , | 8 Comments