Civil 3D.Net – Civil Namespaces

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.

image

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.

Application

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

DatabaseServices

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.

Land

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.

Conclusion

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.

4 comments

  1. john coon says:

    Joshua,

    thanks for the description, it helps a lot. Do they have plans on releasing
    any papers that describe the properties, methods available other that in the arx helps files. I can’t seem to find any (much) data other than in the forums that shows samples or describe some of these tools and how to interact with civil objects. I’ve been trying to transition from VBA to VB but it’s difficult with limited documents

    john

  2. John,
    I am assuming that when you say “they” you are referring to Autodesk. If so, I am not sure what they are planning and that is kind of the reason why I started this series.

    There are a lot of good guys working for Autodesk on the development side and so if I was to guess, there will be as much documentation and help provided with each release as they are allowed time to prepare but I don’t think that really answers your question.

    Can you provide me some examples of issues that you have had or are having? I will then try to write a post about them as time permits.

  3. Songkran says:

    thanks for the description, it helps a lot.

  4. Josh,
    Not sure, but it seems John Coon may be looking for a Developer’s Guide which does exist for C3D. It contains Object Hirearchys, descriptions, and sample code. Here’s the download link: http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=8777904