Sunday, 27 March 2011

New Autodesk employee Civil3d API programming Blog

For those that like to get under the hood of Civil3d this new blog maybe of interest for the future.

New Zealand Civil3d University 2009 paper

Here is a link to download the paper I wrote for the Civil3d University 2009 its on doing things with pipes beyond the standard out of the box stuff.
To give those interested a feel for the sort of things that will be presented this year.

Thursday, 24 March 2011

ProfileView Major and Minor Interval Greyed Out

Just scratching my head for a bit why were the Major and Minor Intervals greyed out
because the “Match ProfileView Gridline Spacing Option” was ticked on at the bottom of the dialog
always gets me.

New Zealand Civil3d University 2011

Can’t make it to Las Vegas then check out the second New Zealand Civil3d University. See you there.

Tuesday, 22 March 2011

Watermain /Pressuremain / Forcemain modelling with Civil3d and EPAnet 2 Part 2

Found this basic SHP to EPA .inp file converter on the internet today
Just thinking maybe you can
1. Export your watermain network from Civil3d to SSA
2. Do a GIS .shp export from SSA

3. Use the converter above to convert the .shp file to a .inp file
4. Open the .inp file in EPAnet and import it.
5. Do your modelling
6. Do a shp export from EPAnet? (Do not think you can do this)
7. Import the shp file into SSA
8. Import your SSA network back into Civil3d.

Civil3d 2012 Preview

Got invited to join in on the Autodesk Bloggers preview of Civil3d 2012 this morning thanks to David Mills at Autodesk and
Chris at civil3d reminders who is a much faster blogger than I am and has put up a number of screen captures of what was shown on his latest blog post.
I number of great improvements in roading and super elevation for the roading guys out there.
Excellent new tools for managing your styles, importing, exporting, purging and conflict notification and over writing and deleting abilities that I know everyone will enjoy. These are apparently fully accessible from the .net API so should be able to do batch purging to get those old file sizes down and cleaned up.
New ability to create a pipe network directly from council GIS .shp file data and new catchment objects. None of the demonstrators were sure if the catchments objects can be linked to outlet structures yet for your analysis but hopefully they can as I know I waste a lot of time doing this manually.
Improved surface banding can set an interval for the bands now. Still not sure if you can save the color scheme like you use to be able to back in 2008 forgot to ask about that one.
Corridor Sections work thru intersections now and you can have more than one baseline in a section view.
Personally asked about any improvements on getting pipe invert levels at structure walls and true pipe grades and also accessing this data in labels and bands. Apparently a new rule has been created to join pipes to the outside of structures and give this data but not seen as a major improvement this release. Hopefully we can get this data in the labels and bands.
Forgot to ask about any .net API improvements particularly for Pipes and Profileviews so will have to wait for the official release and read the help.

Monday, 21 March 2011

Free Screen Capture Utility

I have been looking around for a while for a free screen capture package that allows you to record clips longer than the 5 min limitation on Techsmith’s Jing
that I typically use. BBFlashback’s free Express versions looks like it maybe up to the job and record clear high quality clips.

Sunday, 20 March 2011

Opening and running the shipped Civil3d 2011 samples with VB Express 2008

There are a number of samples shipped and installed with Civil3d 2011 in the following directory.

<installation-directory>\Sample\Civil 3D API\DotNet\VB.NET\

These samples are a good place to start to see:-
1. How a project is written.
2. What happens when you build a project.
3. Practice stepping thru code watching what is happening and debugging it.

If you are using VB Express version like me then there are a number of things you have to do to get the shipped samples up and running.

Here is what I had to do to get the pipe sample up and running with VB Express 2008 and Civil3d 2011.

1. Copy the whole pipe sample file from
C:\Program Files\Autodesk\AutoCAD Civil 3D 2011\Sample\Civil 3D API\DotNet\VB.NET\PipeSample

to a new location to work with that you have full read and write access too.

2. Open VBExpress 2008 and goto File->Open Project Open browser to the sample file location and select the PipeSample.vbproj file.
3. On opening the file you will see alot of errors this is because the references need updated to you local ones.
Goto references by selecting the project name right click and select properties and then the references tab. You will see the references the program can not find highlighted in yellow below.

All of these references files are in the the program install directory click add goto the browser tab and browse to the program install directory and find them again. Make sure copy local is set to false.
4. Now if you insert a break point and press the green play button. You get an error

Tip turn on the line numbering in VB Express so that you can quickly find the lines with errors and easily communicate with other people which line of code you are talking about.7
This error in fact
5. This error is generated because you can not set the default program to be associated with the VBexpress .dll you have created with VB express to be launched and used during debugging.
6.To get around this issue you have to add a couple of lines to the PipeSample.vbproj file to allow VB Express to launch Civil3d during debugging so you can step thru the .dll file to see what is going on. Open the file and find the line highlighted in blue and add the lines highlighted in yellow.
For a more complete explanation of the process please refer to the DevTV video VBA_migration at the 28 minute mark onwards. 

7. Now go back to VB Express and press the green play button. The .dll file should build and Civil3d 2011 should be launched.
8. Once Civil3d has finished loading type the “netload” command and browse to the complied .dll file usually found in the following location


9. Now the .dll file is loaded into memory you have access to all the custom commands in the .dll file such as the command “Pipesample”.
10. Type the command “Pipesample”  and the custom command will start and immediately jump into the code in the .dll file at the position you inserted a break point at in step 4.
11. Now you can step thru the lines of the code in the .dll file by pressing the F8 button and you will be able to see what the code is doing. If you want to see what data is stored in a particular variable hold the mouse over the name of the variable and a pop box will come up displaying its current value.
Good luck with your coding.

Wednesday, 16 March 2011

Watermain /Pressuremain / Forcemain modelling with Civil3d and EPAnet 2 Part 1

Once you get into using Civil3d you soon get into pipe networks and using the different storm and sewer extension packages and get a few jobs under your belt. But eventually
you get asked the question. So can you model up this watermain network for us as well at the same time?
You do a bit of reading of the help files and shock horror you find that you have paid all this money but you still cannot model a simple watermain network? Wait this is civil engineering
isn’t it? Watermain’s people need water to live don’t they.
What do I do now. Wait for 2012 don’t count on it, buy the missing link from a third party developer or figure out another
workaround that's free. You bet that’s the option for me.

  1. Goto the US environmental protection agency website and the EPAnet page download the EPAnet program and Manual. Note the word free
2. Jump to page 125 and Appendix C of the user manual for a description of the EPAnet import file you are required to build.
3. Now in notepad build yourself a base template file for the import file that you can use to paste data into from a Civil3d pipe network.
4. Go into the Civil3d job containing the network you want to analysis.
a. Right click on any part in the network and chose edit network to
bring up the following dialog.
b. Click on the Pipe Network Vistas button at the end.
c. Go to the pipes tab and select the grey column titles and right click. Turn off all the columns of data you do not need.
d. Click in the grid of remain data. Press Ctrl+A to select all the data . Right Click and select copy to clipboard
5. Paste the correct pipe data into your template file in notepad in the correct locations. Make certain you add the pipe roughness and that your
structure and pipe names do not have spaces in them.
6. Save the file and then find it in windows explorer change the file extension from .txt to .inp so that EPAnet will find it.
7. Open EPAnet and goto File->Import->Network
8. Now we are cooking with Jungle Juice and hopefully all has gone well and there you have your network ready to analysis in EPAnet
9. Do your analysis. Once finished go back to Civil3d and manually make the changes required just like the old days.
Here is an idea maybe Autodesk could pickup the game instead of changing the colour of the buttons for the third year running add some useful piping functionality  like two simple buttons for the import and export of networks to EPAnet 2 or the inverts of pipes at the inside walls of structures that we have been waiting on for 4 years. I am sure someone could write the code in a couple of days for both but that’s not my job. This satisfies my rant for the day and good luck.

Tuesday, 15 March 2011

Graphical Corridor Overrides Removing

I am a fan of using the ctrl key and clicking on links in the cross section editor to display the grips that let you drag and edit batter etc graphically to match up to key points on the existing ground surface.
If you are in the cross section editor however and graphically edit a section delete links, points etc, your are no longer able to edit any information in the parameters editor.
I remember this from an Autodesk DVD from about 2007 when the guys that actually wrote the program demo it and explained that this happens.

Now there is no blinking remove overrides button in the cross section editor. So how do you remove your graphical editing of corridor’s cross sections so you can revert back to using the parameter editor dialog box?
Go into the corridor parameter editor. Scroll over to the columns that are always hidden off to the side that you forget about.
Find the region that you have applied overrides to in the list and there in column called overrides click on the button with three dots.
From here you will be able pick and choose the overrides you want to delete or delete all.
Aside to self
This actually did not resolve the issue I had with this particular corridor.There was another issue I had split the corridor into two regions with the split tool and it made the end and start chainages of the new regions the exact same chainage. This being the case you could not apply overrides to this section so I had to do the old trick of subtracting a 10mm adjustment off the end chainage of the first region and then you could apply overrides to the start section of the next region.
Related Posts Plugin for WordPress, Blogger...