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.
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.
- Download and Install VS Express 2013 for Windows:
- Run Visual Studio Express.
- In VS Express, open the C3DPipeNetworkRules.sln file:
- C:\Program Files\Autodesk\AutoCAD 2015\C3D\Sample\Civil 3D API\C3DPipeNetworkRules\C3DPipeNetworkRules.sln
- In the Solution Explorer, right-click the project name C3DPipeNetworkRules, and click Properties.
- On the References tab, click the Reference Paths button.
- In the Reference Paths window, click the … button.
- 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)
- C:\Program Files\Autodesk\AutoCAD 2015
- C:\Program Files\Autodesk\AutoCAD 2015\C3D
- After adding the folder(s), click the OK button.
- In the Solution Explorer, open the Utilities.vb file.
- Scroll or go to line 306 (Ctrl+G).
- 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
- Build the solution (Ctrl+Shift+B).
- By default, you will find the compiled C3DPipeNetworkRules.dll file in this location:
- C:\Program Files\Autodesk\AutoCAD 2015\C3D\Builddir\x64\Debug\bin\C3DPipeNetworkRules.dll
- If having difficulty finding the build location, in the project properties (step 4), on the Compile tab, check the Build Output Path value.
- The actual location of the C3DPipeNetworkRules.dll file Civil 3D uses is located in this directory:
- C:\ProgramData\Autodesk\C3D 2015\enu\
- Rename your original C3DPipeNetworkRules.dll file to C3DPipeNetworkRules-Original.dll
- 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.