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

7 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.

Noel said...

What's next after creating dll, how to import it instead of pkt file.
Thanks,
Noel

Christopher Fugitt said...

The file is located here:
"C:\ProgramData\Autodesk\C3D 2023\enu\C3DStockSubassemblies.dll"
It's a hidden folder, so doesn't get searched by default.

Replace the year with your desired Civil 3D year.

The "AcTpCatalog.atc" points to other atc files.

For example, the "Imperial - Daylight" points to the "Palettes\Imperial - Daylight.atc" file.




Imperial - Daylight





Which then has a collection of tools, for example, this is the DaylightMaxWidth subassembly. The "






_DaylightMaxWidth subassembly

WBH
HELP_HHWND_TOPIC
SA_DaylightMaxWidth







UseDotNet
Subassembly.DaylightMaxWidth


R2019
0

0
1


0.25
0.25
10
0

0
1
2


0

0
1


1.5
6
3

0
1
2
3


1.0
1.0
Rip Rap
0.5
0.5
Rip Rap
0.25
0.3333
Seeded Grass


foot

Christopher Fugitt said...

Dang it, it stripped out the symbols. You'll have to look in the atc files to see the code.

Noel said...

Thanks very much Chris. I found the file. This topic is so complicated and not running in C# and no tutorial video in YouTube. unlike Sub Assembly Composer. But I like to change gear since SAC have no looping and subroutine and also the Report message is just fix string.

Noel

LinkWithin

Blog Widget by LinkWithin

Ad