Share

Converting VBA Subassemblies to .NET

Product Documentation
Intermediate

You can convert AutoCAD Civil 3D stock subassemblies that are VBA-based to .NET.

In Civil 3D 2007, and in earlier versions of Civil 3D, the subassemblies that were included in the product were created using VBA.

In Civil 3D 2008, all of the subassemblies included in the product were created using .NET. This is because .NET versions of subassemblies provide faster performance than VBA-based subassemblies when generating corridor models. Civil 3D 2008, and later versions, still support VBA-based subassemblies. For example, in drawings, catalogs, and tool palettes, you can have a mix of VBA-based and .NET-based subassemblies. However, it is recommended that you convert VBA-based subassemblies to .NET using the following procedure to achieve optimal performance when generating corridor models.

Note

This command only converts the VBA-based AutoCAD Civil 3D stock subassemblies that were included with the product. It does not convert any VBA-based subassemblies that were created from user-defined (custom) VBA code.

To determine if a subassembly is VBA-based, .NET-based, or created from a polyline, use the Subassembly Properties dialog box or the Properties palette to display the subassembly definition.

For information on creating custom subassemblies, see the AutoCAD Civil 3D Developer’s Guide.

To display the subassembly definition in the Subassembly Properties dialog box

  1. Right-click a subassembly in the drawing and click Subassembly Properties.
  2. In the Subassembly Properties dialog box, click the Parameters tab.

    The Defined From field displays .NET if the subassembly was created using .NET, VBA if it was created using VBA, and Entities if the subassembly was created from a polyline.

To display the subassembly definition in the Properties palette

  1. Right-click a subassembly in the drawing and click Properties.
  2. On the Properties palette, click the Design tab.

    The Geometry Generate Mode property displays .NET if the subassembly was created using .NET, VBA if it was created using VBA, and Entities if the subassembly was created from a polyline.

To convert subassemblies from VBA to .NET

  1. Click Modify tabDesign panelConvert VBA Subassemblies To .NET.At the Command prompt, enter ConvertVBASAsToDotNET.
  2. Do one of the following:
    • To convert all subassemblies in the drawing, at the command line, enter A, and then press Enter. All VBA subassemblies in the drawing are converted to VB.NET.
    • To convert all subassemblies in a selected assembly, select an assembly, and then press Enter. All VBA subassemblies in the selected assembly are converted to VB.NET.

Ribbon

Modify tab Design panel Convert VBA Subassemblies To .NET

Menu

Corridors menu UtilitiesConvert VBA Subassemblies To .NET

Object Context Menu

Right-click subassembly Subassembly Properties

Right-click subassembly Properties

Toolspace Context Menu

Prospector tab: Subassemblies Right-click <subassembly name> Properties

Command Line

ConvertVBASAsToDotNET

Dialog Box


Was this information helpful?