This code reads a xlsx file containing information about standard penetration test (SPT) and creates a DXF file with the drawing of all the boreholes listed on it with a legend.
This is the file that will be used to store the borehole data you want to draw. The columns needed to run the program are listed in the table below with an example.
borehole_name | initial_depth | initial_depth | material |
---|---|---|---|
BH-01 | 0 | 1 | clay 1 |
BH-01 | 1 | 5,5 | clay 2 |
BH-02 | 0 | 2 | clay 1 |
BH-02 | 2 | 6 | rock |
The guidelines to create the table are pretty simple. Each line of the file represents a layer of a different material, with the initial_depth and the final_depth of a given borehole. Every time the material or the borehole changes, you add a new line. The 4 columns must be filled in order to run the program.
The program will create one layer for each material in the data source, with the same name of the material. These layers will hold the HATCH DXF entities. Also, the "information" layer will be used to store the box with the name of the borehole (text and polyline entities). The layer "0" will be used do draw the polylines of the squares surrounding the HATCH entities.
The program uses the default AutoCad Color Index to differentiate the materials. The first material will use color 1, the second color 2 and so on. For this reason, the limit of materials that you can use in the same file is 255. The colors of the materials can, later on, be easily changed by changing the color of it's layer.
The program associates the polylines with the hatch entities, so you can easily change the depth of the materials in a CAD application as showed bellow.
The requirements for the program can be found in the file requirements.txt
Run the program via CMD or IDLE and select the xlsx file that has the borehole data in the window that just opened. The drawing will be saved in the same path as the python main.py file.
The borehole_example.xlsx can be used to test the program. The result must be equal to the image listed bellow the title