For localization purposes, the Autodesk Civil 3D stock subassemblies use an external codes file to define the point, link, and shape codes referenced in the subassemblies.
The external codes file is named C3DStockSubassemblyScripts.codes and is located in the same folder as the C3DStockSubassemblyScripts.dvb file and/or C3DStockSubassemblies.dll file. By default, on English-language based systems, this location is typically C:\ProgramData\Autodesk\C3D <version>\enu. For non-English-language-based systems, the “enu” location corresponds to the appropriate language or region.
The codes file is associated with each subassembly with the CodesSpecific module in the .dvb file. The following sections explain the definition of the code files and how to edit it or add point, link, and shape codes to it.
The CodesSpecific module is in the CodesSpecific.vb file of the C3DStockSubassemblies VB project in the case of .NET subassemblies, and in the .dvb file in the case of VBA subassemblies.
Understanding the C3DStockSubassemblyScripts.codes File
You can open the C3DStockSubassemblyScripts.Codes file with any text editor. Add comments in this file by adding // in front of a sentence. Do not leave any blank lines in the file. Each code line is separated with a return character. Each code definition is comprised of the following components, separated by commas:
- Index Number: An integer value used (for a point, link, or shape as required) to assign a label to the subassembly module.
- Localized Code: The value that will be displayed Autodesk Civil 3D in your Subassembly, Assembly, and or Corridor Properties Codes tab, and is used to set the style for the link.
- Original Code: The code variable used by Autodesk Civil 3D. No matter what localized version of the subassembly is used, it is interpreted the same way to make drawings portable across different language versions.
- Code Description: A localized description to further explain the functionality associated with this code. This text is displayed in the Description column of the Codes tab on the subassembly, assembly, and or corridor properties dialog box. This text is optional.
The following is an example of a code definition line in the C3DStockSubassemblyScripts.codes file:
38,BottomCurb,BottomCurb,Bottom of curb for a curb without gutter.
The Index number is: 38
The Localized Code is: BottomCurb
The Original Code is: BottomCurb
The Code Description is: Bottom of curb for a curb without gutter.
Modifying Default Codes for Autodesk Civil 3D Stock Subassemblies
To change or localize code display names, open the C3DStockSubassemblyScripts.codes file in a text editor and change the Localized Code and or corresponding code description.
For example, the display name of the Curb Bottom can be changed by editing the following bolded components in the C3DStockSubassemblyScripts.codes file as follows:
38,BottomKerb,BottomCurb,Bottom of kerb for a kerb without gutter
Adding a New Code to the Autodesk Civil 3D Stock Subassemblies
If you want to modify existing subassemblies to new codes, or add a new subassembly module, and you would like to use the same structure as default content, for .NET subassemblies you can do the following:
- Add <New Code> at the end of the C3DStockSubassemblyScripts.Codes file, with a new index, localized name, original code, and optional description.
- In the CodesSpecific.vb of the C3DStockSubassemblies VB project, add the following at the end of the AllCodes structure: Public <New Code> as CodeType
- In the CodesSpecific.vb of the With/End With block of the FillCodeStructure routine, add the following at the end: GetFromCollection colCodesAndDescriptionHashtable, n, .<NewCode>
- Declare the default value, in case the codes file is not found, for the CodesDefault(<New Code Index>) in InitializeDefaults() function of the CodesSpecific module.
- Change the size of array CodesDefault in the CodesSpecific module in the Dim statement.
A new code added using these procedures can be used for any existing or new .NET-coded subassemblies in Autodesk Civil 3D Stock Subassemblies.
For VBA subassemblies, you can do the following:
- Add <New Code> at the end of the C3DStockSubassemblyScripts.Codes file, with a new index, localized name, and optional description.
- In the CodesSpecific module of C3DStockSubassemblyScripts.dvb file, add the following at the end of the AllCodes structure: g_s<New Code> as CodeType
- In the CodesSpecific file, in the With/End With block of the FillCodeStructure routine, add the following at the end: GetFromCollection colCodesAndDescriptionHashtable, n, .g_s<NewCode>
- Declare the default value, in case the codes file is not found, for the g_arrDefaults(<New Code Index>) in InitializeDefaults() function of the CodesSpecific module.
- Change the size of array g_arrDefault in the CodesSpecific module.
A new code added using these procedures can be used for any existing or new VBA-coded subassemblies in Autodesk Civil 3D Stock Subassemblies.
Localizing Subassembly Catalogs and Tool Palettes
The default subassemblies are generally defined for a wide range of clients and geographical regions. You may want to change some of the display names of catalogs, palettes, tools, or tool variables as applicable to various situations and languages. These catalogs and tool palettes are composed in XML format, in .atc files, and can be edited.
The following list identifies the data element values you can change in the subassembly tool catalog .atc file for localization purposes:
- The <ItemName> value is the descriptive name of the catalog, category, palette, or subassembly.
- The <Description> value describes the catalog, category, palette, or subassembly.
- The <Keywords> value contains a help string for subassemblies.
- The following attributes of the <Params> data element:
- DisplayName: Name displayed in the AutoCAD Properties window for a selected subassembly.
- Description: Descriptive text that is displayed at the lower left corner of the AutoCAD Properties window for a selected subassembly.
- The following data element values can be changed if needed:
- The parameter values (such as Width in BasicLane subassembly) for any sub-element in <Params>.
- The <Units> value which supports feet and meters in Autodesk Civil 3D.
- The <DotNetClass Assembly = ...> (for .NET subassemblies), which can be modified to point to a different .NET class.
- The <Macro Module = ...> (for VBA subassemblies), which can be modified to point to a different macro.
Installing Country Kits, Customized Codes Files, or Locale-specific Codes Files
If you plan to install a country kit that contains a region-specific codes file, or, if you plan to install (use) a codes file that contains region-specific content, you must do the following before installing the country kit, or before installing the customized codes file.
Make a backup copy of the region-specific or customized codes file, rename it to the default name of your installed codes file (for example, for English version products, the default codes file is named C3DStockSubassemblyScripts_US.codes) and copy it to the following location: C:\ProgramData\Autodesk\C3D <version>\enu. For non-English-language based systems, the “enu” location should correspond to the appropriate locale.
Note that when Autodesk Civil 3D is first installed on a new machine, the following two versions of the codes file are installed:
- C3DStockSubassemblyScripts.codes
- C3DStockSubassemblyScripts_US.codes
The C3DStockSubassemblyScripts_<locale>.codes file (in this example, C3DStockSubassemblyScripts_US.codes) is installed to provide a backup mechanism for securing codes file content.
When a country kit that contains a region-specific codes file is installed, the localized codes file is installed to C3DStockSubassemblyScripts.codes overwriting the existing file, and a copy is made at C3DStockSubassemblyScripts_<locale>.codes. If you have modified your C3DStockSubassemblyScripts.codes file, this is why it is important to make a backup of it before installing the country kit, or locale-specific codes file.
Troubleshooting Codes File Issues
If you are experiencing unexpected results when using customized subassemblies, or when performing certain Autodesk Civil 3D corridor modeling tutorials, this may be due to the drawing attempting to reference codes file information that it cannot find. In some cases, these issues can be resolved by updating your existing codes file so that it contains the necessary information.