The Profile class represents a vertical profile along an alignment in Civil3D.
Autodesk.Civil.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ Entity
└─ Feature
└─ Profile
| 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 |
| Method | Return Type | Description |
|---|---|---|
ElevationAt(double) |
double |
Gets elevation at station |
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();
}- Alignment - Parent alignment
- CivilDocument - Document container