Generating 3D Topography from a 2D DWG file

Being an MEP guy, topography is one of those things in Revit I don’t deal with too often but the general concept of working with topography isn’t tremendously difficult.

The two main options you have for automagically generating a topography surface are to either import from a DWG file that contains 3D surfaces – generally these would be topography triangles, or to generate from a list of points in a CSV file.

2016-12-05_11-33-45

The problem is, sometimes you won’t get a DWG file with 3D surfaces and you don’t have a CSV file either.. in fact the surveyor sent you a DWG file with surface points at a 0 elevation. Useless right? Well maybe not quite. Before you jump up and down telling the surveyor to “Do your job properly” and demanding the file in 3D you might be able to impress everyone with your skills and get quicker results.

Step 1 – Extracting the data from AutoCAD

Firstly you want to extract the usable information from AutoCAD. You need to have a really clear understanding of the data you’ve been given. Survey drawings could contain spot information for elements such as buildings, trees, fences and other non-surface information so you need to make sure that you’re grabbing only the information that is relevant to the topography surface. The last thing you want to be doing is telling everyone that the data is rubbish because “these random spots I decided to look at are 5m higher than the surrounding surface, the surveyor must be wrong”

Using your preferred workflow, strip out all the information from the DWG file not related to the surface. My method is to freeze off unrelated layers and then copy and paste what remains to a new DWG file

2016-12-05_12-00-23

This will more than likely leave behind linework that isn’t required to generate your topography. You can remove anything from the DWG that isn’t a point or text if you like, but leaving the information in the DWG won’t affect the process. If there is any MTEXT in the file, select it and explode it so it becomes regular text (DTEXT).

If you’re removing the redundant linework and only leaving points and text, once finished the before and after should look something like this

2016-12-05_12-02-34

The next step is to use a lisp routine to generate 3D points from the text that identifies the elevations throughout the drawing. You might already have a lisp routine that does the job, but if not a quick search on Google and the top result is this page from CADTutor which has the source for a lisp routine from the user Geobuilder. This is why we had to explode our MTEXT as the lisp routine only works on single line DTEXT.

Text to Points LISP

Copy and paste the lisp code into Notepad and save it as something you’ll remember. I’ve saved mine as txt2point.lsp

2016-12-05_12-13-53

In case you were unaware, the command for a lisp routine is defined after the code (defun C: so in the instance of Geobuilder’s lisp routine, the command is Convert_Text_to_Point

Load the lisp into AutoCAD and run the command. When I run the command, I simply selected all text.

2016-12-05_12-17-49

Once done, your DWG file will look something like this. To change the display of your points from dots to crosses, you can change the PDMODE variable. In the screenshot below my PDMODE is set to 2.

2016-12-05_12-19-22

The next step just as a is to remove all points that have a Z value that is equal to 0.0. Remember the information we received from the surveyor had points at 0,0 and we’ve now just generated a new set of points from the text labels. This means we’ll have duplicate points, some with a Z value of 0.0 and some at the correct Z value. Removing these points is simple to achieve by using the Quick Select tool.

2016-12-05_12-23-50

Once done, these will leave us with points at the roughly the correct spatial coordinates and elevations. The reason why I say ‘roughly correct’ is that the text insertion point may be offset from that of the original point, in the example I’m using the accuracy was to within 100mm.

The final step in AutoCAD is the DATAEXTRACTION tool. You need to make sure your DWG has been saved before you run the data extraction. The data extraction tool is fairly straight forward, however if you want step by step instructions, you can expand the section below.

Step by Step - Using the data extraction tool

Maniptulation of the Data in Excel

The next step is manipulating the data in Excel so that the points import in to Revit correctly. A lot of people misunderstand how Revit’s coordinate system works which often leads to problems  when working with data between AutoCAD and Revit. Even if your project is in shared coordinates and you can link your DWG file in by shared/world coordinates, imports such as this one where we are bringing topography in via CSV file will not drop in the topography in the correct location.

2016-12-05_16-08-52

In Revit your project base point is exactly that – your project base point. The 0,0 of your project. This means to process our data in Excel we need to subtract the coordinates of the project base point from the survey point we exported from AutoCAD.

2016-12-05_16-35-27

Once you’ve subtracted the base point coordinates from the coordinates of the survey points, the end result should look similar to the screenshot below which lists out all the points in coordinates that are relevative to the project base point.

2016-12-05_16-43-56

 

Finishing Up – Importing The Topography into Revit

The final step of the process is to import the CSV file itself. Again the import process itself is quite simple, but if you’re after step by step instructions you can expand the section below.

 

2016-12-06_13-26-59

 

Step by Step - Importing the CSV to Revit

Tidying up the output

To finish up, you’ll need to review the imported topography and tidy up the output. You can see here that in my example a few 0 z elevation points made it through into the CSV file.

2016-12-06_13-29-24

You can modify the topography using the edit surface tool, it’s up to you how you handle it, in this instance I chose to delete the 0 elevation points however you may want to fix up the elevations of the points to make sure all the gaps have been filled in and the topography is as complete as possible.

2016-12-06_13-51-08

Although it was a fairly lengthy how to, the entire process from start to finish should take no longer than 10-15mins which in most cases is much quicker and far less painful than going into battle with the surveyor over a bunch of 0 elevation points.

2 thoughts on “Generating 3D Topography from a 2D DWG file

  1. avatar Kittisak Arpornwicharnop says:

    Thank you so much for sharing.

Leave a Reply

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match