How to add your knowledge

Introduction

    Table of contents
    No headers

    The instructions in this chapter guide you step-by-step through the process of creating an AutoCAD Map 3D plugin that modifies the AutoCAD Map 3D user interface. For a more detailed description of user interface plugins, see Creating User Interface Plugins.

    C# is used in the following example, but all .NET programming languages can be used to create plugins.

    Note

    Over 70 samples are provided in both C# and Visual Basic, located under <Topobase Install Directory>\Development\Samples, which are documented in Developer Samples.

    In this example, you will create a new document menu item by performing the following tasks:

    • Create a new Visual Studio C# project that builds a class library (that is, a file with a “.dll” extension).
    • Configure the project so that your plugin and the related files are written to the bin folder in the AutoCAD Map 3D install folder when you build your project.
    • Configure the project so that AutoCAD Map 3D is started when you run your plugin from Visual Studio.
    • Configure the project with the class references your plugin class needs.
    • Review the assembly properties to verify that the default values are valid.
    • Add code to the default class.
    • Create a AutoCAD Map 3D plugin definition file (identified by the .tbp extension) so that AutoCAD Map 3D knows about your plugin.
    • Test your plugin.

    The intent of the plugin is to add a menu item to the context menu within the Document Explorer in the AutoCAD Map 3D task pane. Selecting the menu item causes a message box to be displayed with the common “Hello World” text.

    Important

    Testing this plugin requires a workspace containing feature classes based on the Point feature class type. A suitable workspace for testing the plugin is the TB2009_LM_102 Land Management demonstration workspace. The creation of this workspace is described in the AutoCAD Map 3D Installation and Configuration Guide. Alternatively, another suitable workspace is the TBSAMPLE workspace described in Sample 01 - Create Structure.