When moving data from Revit to any structural analysis software, we are facing two main issues:
- Keeping both models synchronized
- Mapping the cross sections from Revit with the cross sections provided by the simulation product
Structural Engineers can transfer Revit models into React Structures in a flexible way using Dynamo.I would like to cover briefly a Dynamo graph to create a one way model exchange workflow from Revit to React Structures.
To get started, let’s follow initial steps:
- Start Revit 2016 and open your Revit project.
- Open React Structures and create a new empty project.
- Start Dynamo 0.9 from Revit Add-ins Ribbon tab and create a new graph.
- Set the graph evaluation run to manual.
Reading the Revit analytical model with Dynamo
Now we are setup and we need to read the analytical model from Revit and move its representation into Dynamo.
- In order to read the analytical model of stick elements into Dynamo, we need to add the node All Elements of Type to our graph. This node takes as input the Revit Element Types node output.
- The Element Types node exposes all element types available in Revit. We should add this node to our graph, connect it to the input of the All Elements of Type node and choose AnalyticalModelStick from the combo box.
- To see the result we could now add the Watch node and hit the Run button.
- At this stage the connection between Revit and Dynamo is set. To view the analytical elements in Dynamo canvas and access their geometry, we need to add the Curves node and connect it to the output of the All Elements of Type node. After the evaluation of the graph, the output will be a list of curves for each of our Revit analytical elements and the geometry will be drawn in the 3D view.
- Now we need to get the cross sections assigned to the Revit analytical model elements. In Revit, cross section names are defined by the family type parameter. To access this parameter we could add the GetParameterValueByName node. This node takes two inputs, an element and the name of the parameter. The input elements will come from the output of the All Element of Type node. To specify the name of the parameter, we will add the CodeBlock node (by double click inside the Dynamo canvas) and set “Family Type”; as our input value. The result will be the family type of each physical element hosting a stick analytical model.
Preparation of the React Structures analytical model
We have now access to the data describing the Revit model in Dynamo however a few additional steps are necessary to do before sending the model to React Structures.
- When you look at the output of the Curves node then you see that the analytical model elements are split in three pieces. We need to find a way to convert these 3 curves into a single curve that will represent a member in React Structures. For this we will use the CodeBlock node to merge curves. The code we need to add into the newly added CodeBlock node is the following://get the list of first curves describing the analytical model and store it
firstCurves = List.FirstItem(curves<2>);
// get the list of second and third curves describing the analytical model and store it
secondAndThirdCurves = List.RestOfItems(curves<2>);
// Join elements from the first list and the second list
- The output of this node is a list of Polycurves describing our analytical model and this list will be used to create bars in React Structures.
- Dynamo is passing data to React Structures into the SI units. This means that units for length in Revit should be set meter. If this is not the case, a scale factor could be applied to the geometry using the Scale node.
- In order to be able to assign cross sections to React Structures elements, we need their names. To achieve this we could connect the GetParameterValueByName node output to the FamilyType.Name node. The output of this node will be the name of the cross section assigned to each of the elements.
Creation of the analytical model in React Structures
Now we need to add to our graph some nodes which will create our model in React Structures.
- The React Structures installation adds a set of Dynamo nodes into the Dynamo for Revit. These nodes can be found under the Analyze/Structural Analysis for Dynamo category. To create a bar in React Structures, the ByCurves node can be used. This node will create a straight element in React Structures using the curve start point and end point passed as input. The input of this node is our list of polycurves objects returned by the previously created CodeBlock node.
- Running the script at this stage generates bars in React Structures, however cross sections are not assigned yet.
- To assign cross sections to React Structures elements, the sections should be available in the current project. To be sure that required sections are available, we will create a new CodeBlock with the following code:
// Create a list of unique section names
// Load sections into React Structures
// return the list of section names
// that should be assigned to each member
- Now, when evaluating the graph, all missing sections are loaded into React Structures if they are present into the active React Structures section database.
- To complete this graph, we need to assign cross sections to the React Structures members. This could be achieved by using the SetSectionByName node. The input of this node is the list of analytical bars created by the AnalyticalBar.ByCurves node and our list of strings output of the second CodeBlock.
- Run the script to assign the proper sections to the React Structures elements.
- With this graph, the Revit model was passed to React Structures using Dynamo as proxy. If we turn the Dynamo evaluation model into the Automatic mode, and if we make any change in the Revit model such as changing the family type, adding, removing or moving elements then it would be propagated automatically in React Structures.
This script is an example of the workflow we could enable using React Structures, Revit and Dynamo. This graph could be extended to manage some additional analytical model elements like curved beams and surface elements and to transfer some Revit analytical model parameters like supports, releases and structural loads.