Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 1.78 KB

File metadata and controls

64 lines (49 loc) · 1.78 KB

Profile Class

Overview

The Profile class represents a vertical profile along an alignment in Civil3D.

Namespace

Autodesk.Civil.DatabaseServices

Inheritance Hierarchy

System.Object
  └─ RXObject
      └─ DBObject
          └─ Entity
              └─ Feature
                  └─ Profile

Key Properties

Property Type Description
Name string Gets/sets the profile name
Description string Gets/sets the description
AlignmentId ObjectId Gets the parent alignment ObjectId
StartingStation double Gets the starting station
EndingStation double Gets the ending station

Key Methods

Method Return Type Description
ElevationAt(double) double Gets elevation at station

Code Examples

Example 1: Getting Profile Elevation

using (Transaction tr = civilDoc.Database.TransactionManager.StartTransaction())
{
    Alignment alignment = tr.GetObject(alignmentId, OpenMode.ForRead) as Alignment;
    ObjectIdCollection profileIds = alignment.GetProfileIds();
    
    if (profileIds.Count > 0)
    {
        Profile profile = tr.GetObject(profileIds[0], OpenMode.ForRead) as Profile;
        
        double station = 100.0;
        double elevation = profile.ElevationAt(station);
        
        ed.WriteMessage($"\nProfile: {profile.Name}");
        ed.WriteMessage($"\nElevation at Station {station}: {elevation:F2}");
    }
    
    tr.Commit();
}

Related Objects

References