Slope Increment – Civil 3D Pipe Rules .NET

When using pipe rules, if the rules adjust the slope, Civil 3D increasingly iterates the slope at 1% until it finds a set of values that match the rules.  This was mentioned by Christopher Fugitt of Civil 3D Reminders in a comment regarding the pipe rules on the Being Civil blog in this post.  For flatter sites, this is too large of a slope increase and drastically reduces the usability of the pipe rules.

Compiling Civil 3D Pipe Rules

This can be changed by recompiling the .NET pipe rules file C3DPipeNetworkRules.dll with a different slope increment value.

Civil 3D Pipe Rules Code

If you have never compiled .NET code for Civil 3D before, here are some instructions on modifying and compiling the Pipe Rules VB.NET code that ships with Civil 3D.

  1.  Download and Install VS Express 2013 for Windows:
    1. http://www.visualstudio.com/downloads/download-visual-studio-vs
  2. Run Visual Studio Express.
  3. In VS Express, open the C3DPipeNetworkRules.sln file:
    1. C:\Program Files\Autodesk\AutoCAD 2015\C3D\Sample\Civil 3D API\C3DPipeNetworkRules\C3DPipeNetworkRules.sln
  4. In the Solution Explorer, right-click the project name C3DPipeNetworkRules, and click Properties.Civil 3D Pipe Rules References
  1. On the References tab, click the Reference Paths button.
  2. In the Reference Paths window, click the button.
  3. Browse to the root AutoCAD and AutoCAD Civil 3D Installation Directory and click the Add Folder button.  (Note that Civil 3D 2014 and prior will only need one path added for the root installation directory AutoCAD Civil 3D 2014)
    1. C:\Program Files\Autodesk\AutoCAD 2015
    2. C:\Program Files\Autodesk\AutoCAD 2015\C3D
  4. After adding the folder(s), click the OK button.
  5. In the Solution Explorer, open the Utilities.vb file.
  6. Scroll or go to line 306 (Ctrl+G).
  7. Change the value for the double to your desired % increment represented as a decimal value (0.01 = 1%).
    [sourcecode language=”vb” gutter=”false”]
    Dim dSlopeIncrement As Double = 0.001
    [/sourcecode]
  8. Build the solution (Ctrl+Shift+B).
  9. By default, you will find the compiled C3DPipeNetworkRules.dll file in this location:
    1. C:\Program Files\Autodesk\AutoCAD 2015\C3D\Builddir\x64\Debug\bin\C3DPipeNetworkRules.dll
    2. If having difficulty finding the build location, in the project properties (step 4), on the Compile tab, check the Build Output Path value.
  10. The actual location of the C3DPipeNetworkRules.dll file Civil 3D uses is located in this directory:
    1. C:\ProgramData\Autodesk\C3D 2015\enu\
  11. Rename your original C3DPipeNetworkRules.dll file to C3DPipeNetworkRules-Original.dll
  12. Copy the C3DPipeNetworkRules.dll from the location in step 13 to the actual location in step 14.

Civil 3D should now be using your modified version of the .NET pipe network rules that you modified and compiled.  Now when creating pipes or applying rules, the slopes should no longer change so drastically to match the pipe rules.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *