This is continuation of a series focusing on Civil 3D’s .Net API. We are going to talk about the main namespaces found under the Autodesk.Civil Namespace. This will hopefully help you find what you are looking for while programming.
First, before we start talking about namespaces let’s first understand what a namespace is. In an application interface as extensive as Autodesk’s, how do you find anything? Well think of how many files are on your computer. How do you find any files that you are looking for? You create a folder organization system and store the files in a place that makes sense and you follow this organizational system for storing anything. The computer may be split into multiple drives even but everything is found under the Computer.
This is exactly the same concept that Namespaces try to accomplish. For Autodesk, every programming interface for any software that they own is found under the Autodesk namespace. From there each, application is broken down (AutoCAD, Civil, etc.). These are like the hard drives on your computer. What we are going to focus on is the main directories (or folders) found under the Civil “drive”, or namespace.
The application is the first namespace and contains only two classes (think: files) under the namespace. However, this namespace is how you are able to interact with the active document. You get the active document property, methods, etc. through Autodesk.Civil.Application.CivilApplication.ActiveDocument
The DatabaseServices namespace contains the base objects that all styles and civil 3D objects seem to built from. This namespace isn’t used much unless you are working with Labels or Base Styles. Base styles would be generic styles that would be used for multiple features. An example of this would be label, marker, and projection styles.
For any coming from a Land Desktop background should be able to pick up the next few namespaces. It seems that Autodesk broke out the objects, methods, and properties of Civil 3D similar to the old Land Desktop modules (LDT, Civil, Survey). Thus under Land you will find the alignments, surfaces, feature lines, grading, parcel, point, profile (okay so we broke the Land Desktop rule with profiles but…) and so on. These objects are stored under the Land.DatabaseServices namespace and their associated styles are under Land.DatabaseServices.Styles
From there the namespaces get even easier to understand. You have Pipe, Roadway (Assemblies, Corridors, etc.), and Survey among others.
I hope this brief look through the Civil Namespaces helps you find what you are looking for.
Please keep the ideas coming. This series will only continue if ideas for what to write about come in.