DXF Import

Templates can be created by importing geometry from DXF files. This is useful when the tunnel design profile is provided by an architect or structural engineer as a CAD drawing, and you want to use it directly as a template rather than entering points manually.

Opening the DXF import

  1. In the Template Editor, select the template you want to import geometry into.

  2. Click the Import DXF button in the toolbar.

  3. A file dialog opens – select the DXF file containing the tunnel profile geometry.

Note

The selected template must have at least one template line (from Template Line Definitions) before importing. If the template has no lines, you will see a warning.

DXF Preview and Assignment dialog

After selecting a DXF file, TunnelCAD reads all polylines from the file and opens the DXF Preview & Assignment dialog. This dialog has two main areas:

Preview canvas (left)

The preview shows all polylines found in the DXF file, each drawn in a distinct color and labeled with a number. Existing template line geometry (if any) is shown as dashed lines in a muted color for reference.

Navigation in the preview:

  • Left-click on a polyline to select/highlight it (drawn in white when selected).

  • Right-click or middle-click drag to pan the view.

  • Mouse wheel to zoom in/out.

A crosshair marks the origin (0,0), which corresponds to the section axis position.

Assignment grid (right)

The grid lists every polyline found in the DXF file with the following columns:

Column

Description

#

Polyline number

DXF Polyline

Description including layer name, point count, and open/closed status

Assign To

Which template line this polyline maps to, or “(Skip)”

Existing

Shows “Yes” if the target template line already has geometry

Assigning polylines to template lines

Each DXF polyline must be assigned to a template line or skipped:

  • Double-click on the “Assign To” cell to cycle through the available template lines and the “(Skip)” option.

  • Selecting a row in the grid highlights the corresponding polyline in the preview, making it easy to identify which polyline is which.

  • Clicking a polyline in the preview selects the corresponding row in the grid.

Tip

If the number of DXF polylines exactly matches the number of template lines, TunnelCAD auto-assigns them in order. You can then adjust individual assignments as needed.

Confirming the import

Click OK to apply the assignments. For each polyline that is not skipped:

  • The polyline geometry (points and bulge values for arcs) is copied into the assigned template line.

  • If the target template line already contains geometry, you will be prompted to confirm overwriting.

Click Cancel to discard all assignments and return to the Template Editor without changes.

Supported DXF content

The import reads all polyline entities (LWPOLYLINE and POLYLINE) from the DXF file. Other entity types (lines, circles, text, etc.) are ignored. Polylines with fewer than 2 points are also skipped.

The DXF polyline’s layer name is shown in the assignment grid to help identify the purpose of each polyline (e.g., a layer named “Excavation” likely corresponds to the theoretical excavation template line).

Important

Ensure that the DXF drawing uses the same coordinate convention as TunnelCAD templates: X = horizontal offset from the section axis, Y = elevation. If the DXF uses a different orientation, you may need to rotate or transform the drawing in a CAD application before importing.

Typical workflow

  1. Receive a DXF file from the design engineer with the tunnel profile geometry.

  2. Open the Template Editor and select (or create) the target template.

  3. Click Import DXF and select the file.

  4. In the preview dialog, verify that the polylines look correct and match the expected profile.

  5. Assign each DXF polyline to the appropriate template line (e.g., the outer polyline to “Theoretical Excavation”, the inner one to “Theoretical Lining”).

  6. Click OK to import.

  7. Click Apply in the Template Editor to commit the changes.