Showing posts with label Civil 3D. Show all posts
Showing posts with label Civil 3D. Show all posts

Saturday, October 14, 2023

AutoCAD API Programming in Visual Basic.Net

vb.net_api


To start API programming for AutoCAD, some softwares needs to be installed.

1. Prerequisites:

Visual Studio:

Install the latest version of Visual Studio. The Community Edition is free and sufficient for this purpose.

AutoCAD .NET API: 

Ensure you have the AutoCAD .NET API installed. This can be found in the AutoCAD ObjectARX SDK. ObjectARX for 2024 version can be downloaded from Autodesk Platform Services Website.

2. Create a New Project:

  • Open Visual Studio.
  • Go to File > New > Project.
  • Choose Class Library (.NET Framework) as the project type but check if it is VB based.
  • Name your project and choose a location to save it.

3. Add References:

  • Right-click on the References node in the Solution Explorer.
  • Choose Add Reference.
  • Browse to the location where the AutoCAD .NET assemblies are located (typically in the AutoCAD installation directory under ./inc).
  • Add references to following files. The files are usually present in folder (C:\Program Files\Autodesk\AutoCAD 20XX\)
    •  AcMgd.dll (This is the main AutoCAD Managed DLL that provides access to the core AutoCAD functionality.)
    • AcDbMgd.dll (This DLL is responsible for database operations in AutoCAD, including working with drawing objects.)
    • AcCoreMgd.dll (This DLL provides access to core AutoCAD services and application initialization.)

In some cases, additional references may be required for some special functions. The additional references are not necessarily to be added to our project. These are following:

    • AcCui.dll (If you're working with custom user interfaces (e.g., ribbon tabs), you'll need it.)
    •  AcWindows.dll (This DLL is needed for Windows-specific functionality within AutoCAD)

For AutoCAD Civil 3D, additional references are required.

    • AeccDbMgd.dll (This DLL provides access to the AutoCAD Civil 3D database and objects. It's specific to Civil 3D)
    • AecBaseMgd.dll (It facilitates database operations and interactions with AEC-specific objects and data within the drawing)
    • AeccPressurePipesMgd.dll (It provides access to networks and pressure pipe networks)

4. Write Your Code:

In the default class file, add the following imports:

Sunday, April 9, 2023

Creating Alignment Using AutoCAD Civil 3D

 

AutoCAD Civil 3D is industry's top software by Autodesk for various types of engineering projects such as roads, highways, motorways, stormwater sewer, sanitary sewer etc. These projects can be classified as Infrastructure projects.

 An Alignment is a Civil 3D entity in two dimension and describes centerline of road or pipe. It's important to create an alignment accurately, as it determines the final layout of the project.

In this article, we will briefly discuss the various options available in autoCAD Civil 3D for creating of Alignments.

Creating an Alignment:

To create an alignment, follow these steps:

  • Open the AutoCAD Civil 3D software and click on the Home > Create Design > Alignment button.

Alignment Command

  • It will open a menu as shown below:

Alignment Creation Menu

  • This menu contains various options for creating an Alignment. I have numbered these options from 1 to 10. Let me describe these one by one briefly.
  • Alignment Creation Tools

It is used to create New Alignment using Tangents and Curves from scratch. It prompts for creation of Tangents and Curves with different options. Also compare it with Create Alignment from Objects.

 This is one of the most frequently used option.

  • Create Best Fit Alignment

If your alignment is very simple alignment and regression equations can be used to describe geometry of your Alignment. Otherwise, you will need to split up your alignment into smaller parts and use the "Create Best Fit Alignment" option. 

  • Create Alignment from Objects

This option can be used to create Alignment from other objects such as Polyline, 3D polylines and Feature lines already created in the drawing. It is also one of the most frequently used options used to create alignments.

  • Create Alignment from Corridor

In certain cases, Alignment needs to be created from feature lines of a corridor. This option will create alignment from feature line of a corridor. 

  • Create Alignment from Network Parts

To represent Network parts on a profile, an alignment will be created so that we can draw its profile and project the network parts on that profile. Further labels can be added to the profile. 

  • Create Alignment from Pressure Network

This option is same as Network Parts but will create Alignment from Pressure Network parts.

  • Create Alignment from Existing Alignment

This option can be used to create Alignment from existing Alignment. 

  • Create Offset Alignments

Offset Alignments are created for various functions such as widening.

  • Create Connected Alignment

Connected alignment can be created using this option. It will associate the alignment with each other at the intersection point and their profile at intersection point will have same elevation. These profiles can be raised or lowered at the same time. It comes handy in creation of intersections.

  • Create Widening

It also creates an offset alignment will widening options.

  Further details of each option can be checked on Autodesk website.