Integrating FME into Dynamo for Revit and Civil 3D

Dave Campanas
Dave Campanas
  • Updated

FME Version

Introduction

Dynamo is an automation tool for Autodesk Revit and Civil 3D that uses a visual process design interface, much like FME Workbench. It will likely be added to more Autodesk products in the future.

dynamoprocess.png

 

For a more comprehensive introduction to Dynamo, please see the Dynamo website.

Like FME Workbench, Dynamo allows the creation and publication of Custom Nodes for others to use in their processes.

Unlike FME Workbench, Dynamo is quite limited in the types of source datasets it can read. This led me to believe that an integration of FME into Dynamo would be useful.

 

Package

From the Dynamo Package Manager, you can install the ImportFromFME package.

DynamoManager.png

 

Clicking on the View Details option will show the following information:

ViewDetails.png

 

There are two nodes in this package:

  • SelectFMESource - uses the FME Specify Data Source dialog to select the source format and dataset parameters.
  • ImportFromFME - imports geometry from most supported FME formats, with separate outputs for Attributes and Geometries. The data can be automatically reprojected by setting the optional Coordinate_System input to a valid CS-MAP coordinate system name. The data can also be offset to fit Revit coordinates by specifying the X and Y Offset values.

 

Usage

SelectFMESource has two inputs:

SelectFMESource.png

  • FME_Home_Folder: This is the location of the root FME installation folder. This is needed in order to connect to FME. Please use a Directory Path node to supply the location.
  • Dialog_Toggle: This provides a mechanism to force the re-selection of the source format and dataset when processing more than one dataset per Dynamo session. Connect this to a Boolean node. Changing the Boolean setting will force the re-selection - the actual Boolean value has no effect.

 

SelectFMESource has a single output:

  • FME_Connection: Connect this to the FME_Connection port of the ImportFromFME node. The output is a JSON object that contains all the reader information, including format, dataset, coordinate system, table to read etc. 

 

ImportFromFME has six inputs:

ImportFromFME.png

 

  • FME_Home_Folder: This is the location of the root FME installation folder. This is needed in order to connect to FME. Please use a Directory Path node to supply the location.
  • FME_Connection: This is the connection parameters to the source dataset. This is a JSON structure normally supplied by the SelectFMESource node, but can also be supplied by String or Data.Remember nodes if the datasource is constant (ie. database or web datasources).
  • Output_Log_File: This is an optional input that provides the location of the FME log file created by the import. This can be useful when an import fails. This input should be a File Path.
  • X_Offset: Revit's coordinate space is limited, and map projection coordinates are usually quite large, resulting in a loss of precision when importing. This setting allows the user to specify a value to be subtracted from the X coordinates to better fit the Revit coordinate space.
  • Y_Offset: This setting allows the user to specify a value to be subtracted from the Y coordinates to better fit the Revit coordinate space.
  • Coordinate_System: Many of the formats FME reads have coordinate systems set on them, as do many Civil 3D datasets. When this input is set to String containing a valid Civil 3D coordinate system name, and the source data has a coordinate system set, the geometry will be automatically reprojected to specified coordinate system.

 

ImportFromFME has two outputs:

  • Attributes: a list of dictionaries containing all the non-graphical attributes of the source data, including both user and format attributes (ie. feature symbology). The dictionaries contain the attribute names and values.
  • Geometries: a list of source data geometries. It should be able to import most types of geometry into Dynamo. At present, it will ignore rasters, point clouds and text.

 

Example

Importing Cell towers as COGO points into Civil 3D from SQLite.

The attached CellSignal.sqlite file contains Cell tower locations with Station IDs and Codes. The attached MakeCOGO.dyn graph uses the ImportFromFME node to import the points and attributes, then creates Civil 3D COGO points from that data with specialized COGO nodes.

Dynamo

ImportCOGO.png

Civil-3D

Civil3D.png

 

The ImportFromFME package should be installed in Dynamo before opening the MakeCOGO graph.
 

Using a static data source

If you are importing data from a web or database table, the source parameters will often only need to be set up when creating the graph, and will not change. In this case you may want to skip calling the Specify Data Source dialog, to speed the process and avoid the user choosing an incorrect source.

In Dynamo for Revit, the Data.Remember node is very useful for this. Send the SelectFMESource output to the Remember node, then send its output to the ImportFromFME node. After the graph is run once and saved, you can remove the SelectFMESource node, and the Remember node will continue to supply the connection parameters.

The Data.Remember node is not included with Dynamo for Civil 3D, so we must use another method. To do this, add the SelectFMESource node, then connect its output to a WriteText node:

WriteText.png

Open the output text file in any text editor, then copy and paste the contents of the file into a String node. In a new graph, connect this String node to the FME_Connection input of an ImportFromFME node:

UseText.png

 

Combining FME and Dynamo workflows

FME has a lot more attribute data manipulation tools than Dynamo and more ways to federate and filter incoming data. You can make use of these tools for your Dynamo process through the use of Custom Formats in FME. The Custom Format is basically a special workspace that allows you to perform all the FME processing required to produce the data in the form you want, then include it as a reader in another workspace, or in a Dynamo graph. You can see a Youtube example of using a Custom Format in a similar manner, as a data source for ArcGIS, at GIS & Data Integration with ArcGIS and FME: Unleashing the Potential of Data-Driven Organizations. For more information on creating a Custom Format, please see the documentation

 

Conclusion

Using FME as a Dynamo data source opens up a world of data that would otherwise not be available to your Dynamo processes.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.