Category Archives: Drawing Management

LOCAL GRID TO KNOWN GRID CUSTOM COODINATE SYSTEMS IN CIVIL 3D and QGIS

In civil engineering jobs, local coordinate systems like mine grids and council grids can be a real headache. Transforming data between them is an ongoing headache throughout the life of that project.

This little cheat will help you create a custom Coordinate System that will allow you to transform data easily in both QGIS, Civil 3D and Infraworks.

Any questions hit me in the You tube comments or this blog post below.

Loading

Pain FREE POINT CLOUDS- Cloud Compare

Big point clouds are here to stay in the Civil world. I feel like Autodesk hasn’t really given us all the tools we need to get the job done. So I want to introduce a great open source program Cloud Compare (download link). Please donate if you start using it heavily.

Cloud compare will really help with the heavy lifting and pre processing of point data before going into the Recap/Civil 3D cycle.

If your feeling lazy watch the video here.

Alternatively read on

Cloud Compare

  1. Drag drop your point data LAS/LAZ/XYZ/CSV straight into cloud compare
  2. Tick off all the things you don’t need. I only leave on Classification, Apply to All
  3. Say Yes to All on the coordinate shift. It will move it back when you export it, so Don’t panic!
  4. Give it a spin and check out those trees (if you have any)
  5. Lets get rid of the trees, select the clouds in the DBTREE (use ctrl)
  6. Go to Edit – > Scalar Field – > Filter by value. We want to filter the ground points which are class 2 (See Classification here). So the range will be from 2 to 2
  7. You will now have a point cloud with no trees in your viewer. Next we want to reduce the amount of points, we call this thinning.
  8. Firstly check how many points you have in your clouds. You can do this be looking at the properties on the left when selecting the cloud
  9. Your final result you want is between 1 -2 millions points if your are working with the survey to create corridors and volume surfaces. (if your are using gradings you might want it to be less than 500k but we can do this in Civil 3d later.
  10. Edit – Subsample
  11. The amount you reduce the point spacing to really depends on what your smallest ground feature you need to be able to extract from the point cloud. So if you know you have a drain that is only 500mm wide that you need to be able to see, don’t go bigger than 500mm. It’s a bit of a trial and error thing though, but the generally principle is we don’t need points every 5 cm.
  12. The last thing you want to do is merge the file together and export
    Edit -> Merge
  13. File -> Save. Cloud Compare will export what ever you have displayed when you click this. Chose LAS/LAZ and change the extension to LAZ when you save. LAZ is way smaller than LAS. Its also a good idea to note the thinning and class you filtered it to.
  14. Now its just a matter of creating a Recap Project and drag dropping this LAZ file in there. Once your done hit save and go over to Civil 3D.
  15. You can read in a RCP file from the Insert Ribbon – > Attach Recap Point Cloud or Type POINTCLOUDATTACH
  16. After you attach, one of the first things you want to do is change your viewframe back to 2D wireframe. It will make the point cloud disappear and replace it with text but you can still use it and you wont get the performance lag you get in 3d wireframe
  17. Now we can select the point cloud and chose “Create Surface from Point Cloud” from the ribbon
  18. Give it a good name and include the capture date of the survey EG-SURVEY_YYYY-MM-DD
  19. Do your self a favour and put a link in the description the the source files you used to create the surface as well.
  20. Don’t click create surface yet. You can now filter the points down more or clip to box only first. But we have already filtered it down pretty good in CC. As mentioned before make sure you are less than 2M
  21. Lastly Make sure you change the filtering to “No filter”. The filter is only used for Unclassified point clouds or photogrammetry points that have trees/buildings and cars in them.
  22. You should now have a surface in Civil 3D that is performance friendly
  23. Do yourself a favour and data shortcut it out. Then data shortcut it in to a separate design file before working.

Loading

QGIS – Creating Longsection Profiles along lines at a specified interval

There are many analysis applications that require long section data or profiles to perform 2d sectional computations. Getting this data seems to be tricky for a lot of these users, so in this tutorial I want to share a method that’s free and easy using QGIS (2.18.4 when I wrote this).

Watch the video here if you’re feeling lazy.

Prerequisites

  • Vector Data for lines (SHP file, Excel Start/End Coords)
  • Raster Data (Geotiff(s)/Esri Grids etc.) contain desired elevation data. You can use multiple rasters if desired for geology etc,
  • QGIS Version >2.18
  • “Locate Points Along Line” – Plugin Installed (demonstrated in video)

Process

In the image below we have a series of lines that we wish to extract elevation data along.

Typically we will start with data that looks like below, its really important that we have at least

  • Easting and Northings of Start/Ends or vertices.
  • A group field to determine which points belong to which lines
  • And an order field to determine which direction the lines is drawn in.

Save this file as a csv somewhere

Now click the big comma on the left to load a csv in QGIS

Ensure “comma” delimiter is checked, “First Record has field names” is checked. (typically it does) and that the X field and Y field are choosing the correct column for geometry, this typically happens automatically.

Finally check the output at the bottom to determine its write.

Very important to note here that you will need to then specify the coordinate system(CRS) this data is in. Right click the layer and select “Set Layer CRS”

Type in the filter to find the correct CRS

All the points have come in but we now need to connect the dots

Open the Toolbox (Ctrl+Alt+T)

Search for “Points To Path” in the toolbox and double click to load

Specify the layer that contains the points, ensure the group (line ID) and order(numbers to determine line direction) fields are selected correctly. Then chose a place to save the shp file.

We now have lines but we need a raster to get elevations from

Either “Drag-Drop” in the Geotiff/Esri Grid etc. you have or select the add raster button on the left

Double check the raster covers the extent of the lines! You may need to assign the CRS for this later as well.

We now have everything but the points at the desired interval to get elevations from. We now need the plugin “Locate Points Along Lines”. Install from “Manage and Install Plugins…” if you don’t have it!

Choose a name/interval spacing and ensure “Keep Attributes” and “Add Endpoints” are ticked on. Then hit run.

Check that you have the desired results and the end points

Finally we need to add the elevations to the attribute table of these points. Right Click on the layer and select “Attribute Table” and you will see current there is no elevation data column.

In the toolbox again search for “Add Raster Values to Points”

Ensure you select the 0.5m interval points layer you created. Chose the rasters to process and also chose a place to save the resulting layer.

Remove the old layer that doesn’t have elevations

Right click on the finished layer and select “Open attribute table”

You should be able to see the elevation column at the end.

Select the top left corner of the attribute table and the press “ctrl+c” to copy all the data out

Then just past in excel and clean as required

Loading

Data Synchronisation Series – using Free File Sync – Local C Drive Sync

We all run into problems with data eventually in engineering. Usually one of the first hurdles on large projects anyway is “displaced data” or data that is stored in multiple places and used by multiple people. Although it is possible to have fancy software solutions like Projectwise, Autodesk Vault and 12d Synergy automatically controlling your data and syncing it around etc., sometimes we either don’t have the money or the time to setup such elaborate systems. Free File Sync to the rescue.

In this blog, I’ll show you how to setup a sync between your c: drive (local) and your network location. Although the same principles apply for any other syncing. This tends to be the most useful for people working on site, or through VPN’s or at home etc.

Prerequisites

  1. Go install free file sync from here. If you use it regularly, I encourage you or your company to donate on the site.
  2. Download these scripts to help you change your environment quickly. Download Local Drive Scripts

Setting Up

  1. Firstly determine your two locations you want to sync to
    1. Local – c:\drives\b (So that the drive mapping stays the same we will create a fake B: drive to ensure referencing is maintained, you can create whatever drive you want)
    2. Server – \\servername\folder\folder etc.
  2. Open the two scripts contained in the zip and edit the paths to match your syncing locations
    1. In “Open B Local.bat” add the path to where you will store your “fake” b: drive
    2. In “Open B In Office.bat” add your server path
    3. Copy both of these scripts to your desktop for easy access
    4. If you only want to sync a specific project determine those paths. Now open free file sync and add the local path to the project in the left folder field and the server path to the right folder field. Then press compare!
    5.  So that you don’t have to keep entering the paths everytime, you can save the sync to the project folder. It’s usually useful to give it a name like
      <Project Name>_<Location 1>-<Location 2> and add it to the project folder base directory. This way all your sync pair history comes up on the left as well.
    6. You should now be able to see all the files that will be copied from the server to your local drive. If you have a lot of data you may want to add some filters to reduce the amount of data that needs to be synced everytime. Things like *.bak files *.dwl and *.dwl2 files may not be needed. You can add them to the filters button up the top.
    7. You may also want to exclude certain folders from syncing to reduce space. Down the bottom left you can see the percentage of total space that each folder consumes. To exclude it via the filter just right click on it select “exclude via filter”. Excluding using a filter saves you from having to exclude it every time you sync. You can use wild cards in the filters as well like *\SOURCE* will exclude any folders staring with source etc.
    8. Once you are happy you have all the filters and correct paths. Press “Start Synchronisation”. This will copy all the files necessary down to your C drive so you can start working

Changing Your Environment.

If your working from home Run the “Open B Local.bat”

If your back in the office “Open B In Office.bat”

Keep on Syncing

1. Once your synced for the first time. You can now run periodic syncing at your leisure. After doing a compare FFS lets you know which files are going where

2. You can turn off the different types of sync by pressing the buttons down the bottom.

3. Its pretty straight forward but:
Purple is files going left
Green is files going right
+ sign means it’s a file
no + sign means its updating an existing file
= means they are the same
BUT MOST importantly the “lightning bolt” means its changed in both locations since the last sync

4. You can change which way things go by clicking the middle bar. This is great for resolving conflicts. Click and drag to do multiple items at once.

5. Press Sync to run. A lot easier than doing it yourself manually! Plus great for working over a vpn as only the files that have changed get sent through. Rather than all the files you access.

In the next blog series on Data Synchronization I’ll talk about how to script this or even use “Real time Sync” that comes with free file sync.

Loading

Creating your Civil 3D company styles “on the fly” the WBLOCK method

Maybe a primitive method but a good one.

Anyone who is new or old to Civil 3D knows how difficult it is to create all the styles you will need to finish projects in a timely fashion. But most of us don’t have the time to sit down and create all these styles. Let alone the will power to just sit down and create styles and nothing else.

So here is a technique for creating styles as you do project work. Using a WBLOCK style inbox.

Feeling lazy.. watch the video.

In a nut shell though, you are working, you create a style. You WBLOCK it out to a common directory. You keep working.

Next chance you get some free time you do some “Style Review and Cleanup”. Incorporate it back into your template. Then Repeat!

The WBLOCK command.

This is also a great method for creating DXREFS with Civil 3D, onto that another time though

Loading

Dynamic Drawing Production Cheats for Civil 3D Objects – Slope Shading and More

Why we all eagerly await the day that all Civil 3D objects, like corridors, become data shortcuts or Civil 3D gets replaced with Infraworks (Not sure which is going to happen first). Until that day though we still need to get those Civil 3D models into our drawings in the most dynamic way possible. So here are a few sneaky tricks to do so, keeping everything as dynamic as possible and not exploding a thing.

  • Surface Slope Shading
  •  Surface Boundary Technique for Linework and hatching
  • DXREF’s data shortcuts in XREFS

Feeling Lazy watch the video. (Coming Soon)

While I love all the slope patterns that get generated from grading’s and corridors. I’m sick of exploding AECOBJECTEXPLODE all my linework from my model and copying it across to my xrefs etc. Every time I update, drives me crazy!

So what If I told you that the image below has not a single bit of exploding in it. Everything is produced via data shortcuts, even the linework, all dynamic. Interested? read on ->

Slope Shading
It’s so simple you will kick yourself for not working it out earlier. To produce the grey slope shading on the surfaces is quite simple. Using the surface slope analysis. Right Click – Surface Properties – >Analysis Tab – > Select Slopes from dropdown.

My embankments are 1:2 cut and 1:2 fill -> so >40% and my road cross fall is 3 %. So im going to drop down two ranges

  • 0.0001% – 10 % and (< -you can’t type 0 exactly)
  • 10% – 999999999999999% (type lots of nines in case you make even steeper areas than you have, then it always updates)

Change the colours to 254 (light grey) and 253 (Slightly darker grey) respectively.

image010image001

Then you should have what I have above, dynamic updatable surface shading. If you can’t see anything then you will need to choose a surface style that has the slopes turned on under the “display tab”. See below. Make sure you set a layer for the slope objects if you want to utilize Autocad transparency.

Linework and Hatching – The Surface Boundary Technique
I unfortunately have to assume that if your reading this you know how corridor point, link and shape codes work. What we can do with these wonderful codes is create surfaces where the surface boundary represents the linework we are trying to display on plan. The Red, White and Orange dashed lines taht represent that linework.

So I create 3 additional surfaces in my corridor properties.

  • DS-ROAD_curb,
  • DS-ROAD_footpath and
  • DS-ROAD_pavement

You will then need to work out the boundaries for them. You can do an interactive boundary if you feel like wasting hours of time. Or just use the Angle/Length Trick.

Tod do so, go to the surface properties for the footpath for example. Definition Tab – > Expand the Build Section and make the maximum angle like 92º and the maximum length about 5m.

To explain what this is doing. It will analyse the footpath surface for triangles that have an angle greater than 90°, quite often these are the weird “spiderwebs” we get on the outside of the surface. Then it will analyse the triangles that have a length on any side greater than the number specified and remove them. It’s important to note that the “Maximum angle” only works on outside triangles, not internal triangles. The “maximum length” will remove triangles anywhere. See the diagram below.

Before Applying Angle/Length Parameters

After Applying Angle/Length Parameters

The finished result is just footpath. You can use this trick on all your surfaces though

Now do the rest of the surfaces as well in a similar fashion. You will need to create a style that has only border displayed to see the finished result. You may also need to play with your corridor frequencies to get the desired result.

Creating a surface style that only uses the border object

The finished Result is dynamic linework though. Using a surface border.

Surface that represent linework only using surface border styles

As for hatching well its as easy as using that hatch command

Putting it all together

The final step is to collate all this together for use in a drawing. Here is my recommended workflow.

  1. So i have data shortcutted my top surface and set the shading.
  2. Data shortcutted my linework surfaces in and created different “border only” surface styles that I needed.
  3. Added a hatch onto the pavement surface.
  4. I also brought in my alignments and station/chainage labels in as well.

Now I simple select it all and WBLOCK it out to an xref location.

The best part about the WBLOCK is that you only have the layers you need in the new drawing. Meaning improved performance when using it as an XREF as well as not doing your head in. WBLOCK does not destroy the data shortcuts either!

Let me know what you think below.

Loading

DOTSOFT tools – Importing Linework from a PDF

Every now and then we find ourselves in a pinch for data. I don’t know how many times I have had nothing but a PDF to go on..

Well, it appears that a PDF is lot more useful than I first thought. Particular If it’s a vector PDF, you can usually tell if it is by zooming in and out on the PDF and you will see all the linework generate separately.

I won’t lie, I haven’t found a free tool to do this yet. But over at DOTSOFT Tools an application called PDF2DWG http://www.dotsoft.com/pdf2dwg.htm for 95 US sheets does get the job done very nicely.

I’ve actually bought the entire toolpac package that comes with PDF2DWG ($245), good value if you ask me. You can find the tool in the ribbon after installing, along with a host of other useful ones.

Select a PDF, even a multipage one

Lots of options here as well. Detect line weights, removing little raster images (particularly use for PDFS generated by GIS programs) and even the ability to convert image-based pdfs to linework (can’t verify how well this works though)

Hit process and voila! Massive time saver, that can pull you out of a “not enough data” situation very quickly.

Loading

Importing high resolution imagery from Google to CAD using QGIS

See my previous post here to see the full process. This is an expansion on this process to bring in more or better quality imagery.

Once you have setup your coord system etc. as per previous post, you then want to zoom your screen down to the desired resolution. I find going one zoom level further in than you like is usually a good strategy.

Now you want to keep pressing “save as image” then panning your screen around to get the tiles you desire. Just use your middle mouse button, don’t zoom in and out. Give the images about 5/10% overlap.

Once you have saved all the images you need. Just read them back in to have a look at the finished result. I have saved 6 images below.

Now I want to merge them together as one image.

Raster -> Miscellaneous -> Merge

image004image005

So now you just need to output your merged image in the desired coordinate system.

Right click the layer and press “save as”

Make sure you tick “rendered Image” and specify your desired coord system.

Give it a short moment to output

Now read into cad. Don’t forget to set your units to “meters” on command INSUNITS if you are using the metric system.

You should now have an image in CAD that is better resolution, or covers a more vast area

Loading

Google/Bing etc. Imagery into CAD using Quantum GIS (QGIS)

This is the free option for those of you looking to get some public imagery into cad. Although I imagine if you are using Civil 3D 2015 with the new bing maps functionality. This method is a little defunct. If your using Vanilla Autocad you will need to download the GEOREFIMG lisp from CAD Studio to import

Feeling Lazy… Watch the video


QGIS or Quantum GIS has much more functionality than just saving Aerial Imagery. It’s a very comprehensive and powerful free GIS tool that should be in every designers arsenal.

Firstly install the latest version from https://www.qgis.org/en/site/forusers/download.html

1. Next open up QGIS from the desktop shortcut (im using 2.8.3 Wien when writing this)

2. Go to Plugins – > Manage and Install Plugins

3. Search for the OpenLayers Plugin and Install

4. Next we need some data to quickly get your location correct. Export either a 2007 DXF or MAPEXPORT a SHP file that contains some line work of your area that’s in a known coordinate system.

5. You can either drag drop it into QGIS or just press the “Import Vector Data button”

6. QGIS should prompt you for a coordinate system for your data. If it doesnt, right Click on the layer in the layers window on the left and select “Set Layer CRS”

7. Im in Australia so I select MGA zone 56. QGIS’s coordinate system library is incredibly comprehensive so you shouldn’t have any problems finding yours here.

8. Now the imagery, go to Web -> OpenLayers plugin -> pick a imagery source. Google/Bing/Yahoo/OSM/Apple street and aerial/hybrid sources are available

9. You should now have imagery in. You might need to change the draw order to check that your line work matches up, drag drop them so that your line work is on top.
image009
I
magery in
imagery2

10. Now just get your viewport to the imagery extents you want, then turn off the linework. The image will save whatever you are looking at, in whatever coordinate system you have specified for the project.

The resolution will be what you see is what you get (WYSIWYG) so if you want a better resolution you will need to save multiple images at a closer view. See my post here on how to do that, or watch the video above.
imagery1

11. Now save your image. Go to Project -> “Save As Image” and call it “Google-PSY” the PSY indicates it is in the WGS84 Pseudo Mercator Coordinate system.

12. We now need to read the saved image back in and convert it to the correct coordinate system been – MGA zone 55. Using the Warp (Reproject) from the Raster-> Projections menu.
imagery3

13. Specify the “Google-PSY.png” we saved, choose the output file, Make sure you specify the source coordinate system (WGS84 – Psuedo Mercator) and the target coord system (mine is MGA zone 55)
imagery4

14. Export it as a “Geotiff” and call it Google-MGA55 or whatever your coordinate system is. The Geotiff format will contain all the georeferencing information inside the file.
imagery5

15. Now just use MAPIINSERT command (GEOREFIMG lisp for vanilla cad users) to import into CAD. Pow! Imagery. This also works well for stitching bits of imagery together.

Any questions just ask below.

Loading