Converting CAD Datasets to IMDF: Part 1

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

This is the first article in a three-part series about how to convert AutoCAD to Indoor Mapping Data Format (IMDF) using FME, it covers how to preprocess the data. To be successful in this series, all three parts need to be followed. Template files have been provided to use with your data. Keep in mind some transformers might need to have their parameters changed depending on the data that is being transformed. It is a good idea to run the workspace with Feature Caching enabled and monitor the data as it flows through.

Please note that this article is for demonstration purposes only in Windows. The data is not supplied. If you require data please see the Scenario: Victoria Airport Esri Geodatabase to IMDF article

Disclaimer: These articles are meant to be a high-level overview of what each workspace does and the process by which to convert your data. Open the workspace and examine each transformer’s parameters to learn the specifics.

 

Requirements

Windows Operating System

AutoCAD (for Part 2: Preparing the Preprocessed Data)

Google Earth (optional for Part 2: Preparing the Preprocessed Data)

 

Before You Begin

Before moving into FME, ensure that you have created a Master DWG file that contains all of the layers within your building. Attach floor files as Xrefs with the location set to 0,0,0, the scale set to 0, and the rotation 0:

attachxref.png

Attach each of the floor files with the location, scale, and rotation set to 0 in AutoCAD

 

Workspace Overview

Part 1: Pre-Processing - Aligning floors

IMDF has specific requirements that need to be met in order for the data to be valid. The PreProcess.fmw workspace is part one of three to prepare the data. The first step is to align the floors for the building as well as create attributes with the correct naming convention to meet the IMDF requirements.

unaligned.png

Before alignment viewed in AutoCAD

 

Reading in data

The workspace to process the data looks like this:

preprocessworkspace.png

FME Desktop workspace overview for preprocessing AutoCAD DWG before converting to IMDF

 

A master DWG file of the building, which should contain references to each of the layer files, is read in. When the reader is added, in the reader feature type parameters, additional AutoCAD and Xref Format Attributes are exposed.

A Tester is then used to separate out only autocad_xref files within the autocad_entity.

 

Cleaning up paths

Paths to reference files may be absolute or relative. Another Tester is used to separate out each path type so that they can be dealt with separately. The relative paths go through a FileNamePartExtractor transformer to extract the path name from fme_dataset. Then various transformers are used to turn relative paths into absolute paths.

If the path was already an absolute path, it would have the same _path and _xref attributes created, just without the data cleanup.

 

Reading in Xref

Once paths have been cleaned, both types go through a BulkAttributeRemover to remove all attributes starting with autocad_:

bulkattributeremover.png

Attributes before and after the BulkAttributeRemover

 

A FeatureReader transformer is used to read in AutoCAD DWG features from the reference files, using the _path attribute to specify the file name. Within the FeatureReader, AutoCAD alignment and entity attributes are exposed, which will be used to convert the door symbols to lines coincident with the walls.

xrefbookmark.png

Clean up and read in Xref files

 

Georeferencing

New IMDF location specific attributes are created using the AutoCAD DWG attributes:

New Attribute Attribute Value
_xref autocad_xref_name
_file_rot autocad_rotation
_file_x_scale autocad_xscale
_file_y_scale autocad_yscale
_file_z_scale autocad_zscale

Coordinates are extracted from the master drawing and the difference between master and references are calculated and stored as attributes. These attributes will be used to offset the drawing. The non-IMDF specific attributes are then removed.

coordinateextractor.png

Extract coordinates to be used in the Offsetter

 

extractgeoreference.png

Georeferencing workflow

 

A FeatureMerger is used to merge both the Xref and Georeferencing workflows together based on the _xref attribute, merging only attributes.

The georeferencing is then applied by rotating, scaling and offsetting the drawing. All the layers and rooms are now in the correct location.

georeferencing.png

Before and after georeferencing alignment viewed in the FME Data Inspector

 

Creating Features

With all the layers in the correct place, they need to be separated back out into their different types: Levels (GROS$), Units (RM$) and Openings (ADO). A FeatureTypeFilter is used to filter by GROSS$, RM$ and ADO.

To create the levels (GROS$) a new attribute is created called _outerlayer, this is the outer wall for each of the levels and has the naming convention <layer>_Level.

levels.png

Levels renamed and viewed in the FME Data Inspector

 

Next, rooms are created by using an AreaBuilder grouped by _xref. The walls are then thinned out by converting double lined walls into a single line; this is done by using the WallThinner custom transformer. Finally, the attribute _outerlayer is created which has the value <layer>_Unit.

wallthinner.png

Walls before and after the WallThinner custom transformer viewed in the FME Data Inspector

 

Converting doors to openings is a bit more complicated. First, the door lines need to be snapped together then combined to create a single line representing each door. Then two CoordinateExtractors are used to extract each door endpoint and create vertices.

The vertices are then snapped to the walls using AnchorSnappers. Finally, the attribute _outerlayer is created, and with the attribute value of <layer>_Opening.

openings.png

Endpoints created from doors with coordinates attached, viewed in the FME Data Inspector

 

One last step before the DWG is written out for manual processing in AutoCAD. The autocad_alignment_x/y/z attributes are removed, then the _outlayer attribute with <xref>_<fme_feature_type> and a new attribute called autocad_justification are created.

layername.png

_outlayer and autocad_justification attribute created

 

Writing out to AutoCAD DWG

The writer is set up to write out to AutoCAD DWG format with the layer name _outerlayer. Run the translation then open the DWG file up in AutoCAD. Continue to Part 2 to learn how to edit the file in AutoCAD.

aligned.png

After alignment, viewed in AutoCAD

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.