Ad

Wednesday, November 21, 2012

Civil 3D 2012–C3D Stock Subassemblies

Believe it or not there are some bugs in the subassemblies that ship with Civil 3D. In addition there are some cases in a design where a custom coded subassembly is the best solution. This is especially true when repetitive code is used that doesn’t work well in Subassembly Composer.

To correct any bugs or create your own subassembly a good place to start is using the code that ships with Civil 3D. The code is located at:

C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\Sample\Civil 3D API\C3DStockSubAssemblies

I usually copy the project to a different location. This way you can always get a fresh copy and you move it outside the Window’s UAC. Once open you first must add the correct references. The easiest way to do this is to set the Reference Paths:

image

Next you might notice a plethora of errors showing up. This is because for some odd reason the programmers of the Subsassemblies, they did not like to declare all of their variables correctly. I guess they don’t believe in treating all warnings as errors. Strangely when you open the solution the check box on the compile tab of the project is set to treat all warnings as errors. Unchecking this box will remove all of the errors back to warnings.

image

Next if you are using a 64-bit operating system, or not. You’ll want to change the build target type. To do this open the Configuration Manager.

image

Next select the Active Solution Platform and select the <New… > option. Select AnyCPU from the list and base it on the x64 build.

Next we need to change the target Framework. The setting is set to .NET Framework 2.0. Unfortunately Civil 3D uses .NET Framework 3.5. So go in and change the Target Framework to 3.5.

image

Now rebuilding the solution and replacing the existing dll with the new one should then compile.

C:\ProgramData\Autodesk\C3D 2012\enu\C3DStockSubassemblies.dll

3 comments:

Unknown said...

Is it possible to redefine a subassembly's Code? For example, the built-in "Primary Road Fill Section" assembly's Curb and Gutter subassembly uses Pave1 and SubBase for the Codes; however, most curb is PCC on top of AB not subbase. Since the hatch SubBase is defined in the style and applied to the entire Assembly, it makes it so the curb is built on subbase not AB along this the roadway's AC & AB. How can I change the curb's code to be Pave1 on top of Base?

Unknown said...

Is it possible to redefine a subassembly's Code? For example, the built-in "Primary Road Fill Section" assembly's Curb and Gutter subassembly uses Pave1 and SubBase for the Codes; however, most curb is PCC on top of AB not subbase. Since the hatch SubBase is defined in the style and applied to the entire Assembly, it makes it so the curb is built on subbase not AB along this the roadway's AC & AB. How can I change the curb's code to be Pave1 on top of Base?

Christopher Fugitt said...

Change the code that is assigned to the link in the code. The codes are listed at the top of the subassembly class and then do a search and change the codes.

LinkWithin

Blog Widget by LinkWithin