Import DXF File
Updated 01/2025
Import DXF File Tutorial
Created By: Roozbeh Geraili Mikola, PhD, PE
Email:
[email protected]Web Page: www.geowizard.org
80.0,50.0 130.0,50.0
Sand 130.0,45.0
130.0,42.0
0.0,35.0 56.0,34.0 Clay
130.0,35.0
0.0,30.0 50.0,30.0
0.0,20.0
56.0,20.0
Sand
0.0,0.0 130.0,0.0
This tutorial will demonstrate how to import DXF file into HYRCAN using the Import DXF wizard
tool. In this tutorial LibreCAD, a free Open Source CAD application is used for DXF generation
but please note that HYRCAN is compatible with AUTOCAD as well. LibreCAD can be
downloaded from https://librecad.org/
Create DXF File
First let’s create the DXF file. In order to create a simple geometry using LibreCAD let’s follow
the sequences below:
1- Before start drawing let’s specify some layer names. From menu select Layer List->Add
a Layer and then specify EXTERNAL as a layer name. Please note that the DXF file must
contain only one external boundary otherwise the DXF won’t be generated by program.
In HYRCAN, the external boundary must be CLOSED (i.e. must form a closed polygon
with the first vertex equal to the last vertex). However, HYRCAN will automatically close
an open-ended ground surface polyline. Please repeat the same steps and create other
layers and name them MATERIAL, WATER_TABLE and ANCHOR for the rest of the
boundaries. You can optionally specify the color, width or line type for each layer for better
presentation. Table 1 shows the conventions for layering while creating objects.
2- To draw the external boundary, select Tools->Polyline->Polyline and specify the point
coordination for the external boundary. Now double click on the drawn polyline and choose
EXTERNAL in the property dialog.
1
Import DXF File
Updated 01/2025
Figure 1- Layers Settings dialog to specify new layers.
(a) (b)
Figure 2- (a) draw polyline (b) draw line.
3- To draw the rest of the boundaries (MATERIAL, WATER_TABLE and ANCHOR), select
Tools->Line->2 Points and specify the coordinates. Now select each boundary and
assign the appropriate layer name to it.
4- Save the file in the desired directory and name it “tut10_dxf.dxf”
2
Import DXF File
Updated 01/2025
Figure 4- Final result in the LibreCAD.
Table 1- conventions for layering and entity type
Object Layer Name CAD Entity Type
External Boundary EXTERNAL Closed LINE / POLYLINE
Material Boundary MATERIAL LINE / POLYLINE
Water Table Boundary WATER_TABLE LINE / POLYLINE
Support ANCHOR LINE
Import DXF
To import dxf file into HYRCAN using wizard dialog, select File->Import DXF from menu or
toolbar
Select:
Then follow the steps below:
1. In the Import DXF dialog, click on Select DXF File button and select the required DXF
file and press Open.
3
Import DXF File
Updated 01/2025
2. In case you want to modify the output filename click on Output Filename checkbox and
specify output script filename. By default, the output filename is identical to the input
DXF filename.
3. Then select Unit System. Uncheck the Load Script after Creation if you don't want to
load the created script after generation.
4. Click on Apply button, to generate the script file (i.e. *.hjs). Generated script
corresponding to selected DXF file can be found in the same directory as input DXF file.
Figure 5- Import DXF dialog in HYRCAN.
Figure 6- Final result in HYRCAN after cleaning up the script.
4
Import DXF File
Updated 01/2025
Script
Now you can open the script file, for instance you can create and specify the material to the solid
elements then excavate the tunnel before installing the cable element. The following command
lines shows the output from the wizard tool including the modifications made before cable
installation:
// ***************************
// this part is included after clean up
// create new model
newmodel()
importmodel("dxf","infiledirname","C:/Users/Desktop/tut10_dxf.dxf","outfilename","tut10_dxf.hjs")
// generate external boundary
extboundary(0,0,130,0,130,50,80,50,50,30,0,30,0,0)
// generate material boundaries
matboundary(0,20,130,35)
matboundary(56,34,130,42)
// draw supports
addsupport("single","id",1,"matid",1,"orientation","anglefromhoriz","angle",270,"length",19,"atpo
int",56,34)
// generate water table
addwatertable(130,45,0,35)