All posts by Kapanther

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

Scale Based Rendering and other features for Civil 3d Styles.

Like This Idea Vote It UP here

It would be incredibly useful to allow certain aspects of Civil 3D styles to change dependent on the scale they are visible at. (other than just the size, which happens already of course!)

This could be done at style level or object level or even better both? one overrides the other.

Fox example

  • Contour Intervals could change depending on the scale
  • Alignment Intervals could change dependant on scale.
  • Style could also allow visibility of certain objects only at certain scales.
  • Components could display different information at different scales (labels could become more or less complex)
  • Dragged states could have different locations for different scales (similar to annotative scaling already for regular autocad objects)

I particularly like the way arcgis handles this with scale ranges that make sense, like room, county, building,continent etc..

Like This Idea Vote It UP here

Loading

REPLACEOBJECTWITH – Replace a C3D Object Geometry/Data with another C3D object’s Geometry/Data of the same type

I would like to see this command available for every civil 3d object. In both the toolspace and on right click menu’s/context sensitive ribbon. This is similar to the way styles can be replaced with another style in the settings tab. But instead, the C3D object would be replaced with the geometry/data of another Civil 3D objects. But more importantly, all the links would be maintained.

image003image005

Example – Corridor Modelling (replacing objects instead of retargeting)

This would be particularly useful with corridor modelling. As it would mean targets would not need to be respecified, just the geometry of the target object is replaced and then the corridor can be rebuilt.

So for example below, I have a corridor that targets a feature line, this feature line is used as a conditional horizontal target as well as a target for its horizontal position and vertical elevation.

There are maybe 15 regions that use this one feature line and each region has 4 targets each. Some of the regions use a different subassembly. So using the “Match Parameters” command is not going to work.

Using the “replace object with” would solve this in two clicks. Instead of many clicks in the target parameters box.

Other Uses

  • Replacing Design Profile Geometry
  • Replacing Alignment Geometry
  • Replace Surface geometry with another surface. (rather than promoting and pasting in)
  • Replacing Point Data or Point Groups with another point group.
  • The list really goes on..

The Current Style Replace with.

Not available on all styles. But useful none the less.

 

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

Civil 3D 2017 new features… Finally some core functionality improvements

It’s been almost four years since Autodesk bothered to do anything with Civil 3D. However I am very pleased to see a host of new core functionality improvements that will make everyone’s life easier back in the 2017 version. Even if most of the features are somewhat half-baked.

So what’s changed in Civil 3D 2017 and how can you use it? Fortunately for you, I have made a series of videos for you to see how you can use the new features. I will also highlight some of the limitations in them so you don’t spend hours beating your head against the wall wondering why they don’t work as you expected!

In a nutshell, here are the new improvements

  • Civil 3D Object version has changed,
  • New Corridor Feature Line Extraction workflow
  • A host of Data Shortcut Improvements (Create Folders, Surface Caching, Import Multiple DREFS)
  • Data shortcut corridors (Probably my favourite new feature)
  • Use a feature line as corridor centreline (Very useful!)
  • Corridor Curve Cleanup (Automatically remove bowties… not as good as you think it is and only really good for basic situations, but still a step in the right direction)
  • Corridor Solid Extraction Improvements (Now Dynamic, with property sets for meta data)
  • Civil 3D “property sets” to improve downstream data workflows (attach subassembly data to solids etc.).
  • Feature Line Enhancements (‘No Site’ options, crossing centreline join (median problem fixed),
  • Style Management with Reference Styles (Create a style then “link it” to other drawings, incredibly useful)

Haven’t made all the videos yet. Here are some first passes below.

New Corridor Feature Line Extraction Workflow

Data Shortcut Improvements (Including Corridor Data Shortcuts)

Featurelines as Centerlines for Corridor / Corridor Curve Cleanup

Loading

Creating Custom Parameteric Pipe Structures in Civil 3D Part Builder

Its not everyone’s favourite part of Civil 3D. But I get a lot of questions about it.

Civil 3D Part Builder has the ability to create custom parametric parts of all shapes and sizes. The video below will explain everything in detail, the rest of the blog further below will just run over the stumbling blocks you need to know.

Adding Custom Contexts

To add custom contexts you will need to go to this path and edit the “AeccPartParamCfg.xml”. You will need to restart civil 3D to see the changes in part builder

C:\ProgramData\Autodesk\C3D 2016\enu\Pipes Catalog\Aecc Shared Content\AeccPartParamCfg.xml

Add your custom parameter in the <AeccParamDeclaration> section, just copy another one and change it to suit.

Then add your same context into the <AeccParamUsage> section further below. Make sure you enter it under the correct structure type.

Linking the Custom Context to the Dimensions

To create the link to the custom context parameters you will need to ensure your part is mostly finished first. Ensure you have a dimension in Civil 3D that represents the custom parameter, you will override it in the part’s XML

Now open the parts XML file it can be found in the catalog location here.

IMPORTANT NOTE: opening the part in part builder will reset these changes shown here and you will need to go and do them again

C:\ProgramData\Autodesk\C3D 2016\enu\Pipes Catalog\ANZ Metric Structures\Junction Structures with Frames\AeccStructRectSlabTopRectFrameANZ_Metric_offsets.xml

Inside the XML you will need to find the dimension that represents the basepoint offset width.

IMPORTANT NOTE: opening the part in part builder will reset these changes shown here and you will need to go and do them again

So this is that the line should look like

Adding Custom Sizes

You can add custom sizes in this same XML.

Find the parameter you want to change and copy the lines down. Ensure you update the index number as well.

Updating the Catalog and Validating

When your done making changes you will need to update the catalog in civil 3D. Command PARTCATALOGREGEN, select structures or pipes, whatever you need.

I also recommend validating the parts in the catalog screen.

The results can be found here

C:\ProgramData\Autodesk\C3D 2016\enu\Pipes Catalog\ANZ Metric Structures\Validate

Find your part name and open the txt file.

Everything Else!

I suggest watching the video above.

Enjoy!

Loading

Create Multiple Intersections at once, including cul-de-sacs

Like this idea, vote it up here on idea station!

I think it’s safe to say that the intersection object (that is not really an object)  and the wizard that creates them are from a different age, they are dinosaurs that should have died a long time ago.

Check out 12D’s “Create Roads” functionality. It creates “multiple intersections” at once, as well as creating the cul-de-sacs automatically. Why can’t civil 3d leave the dark ages and develop some functionality like this?

https://www.youtube.com/watch?v=ldqN7PL4S8M

Like this idea, vote it up here on idea station!

Loading