TODO: FINAL REVIEW WAITINGTODO: NEEDS SAMPLE Gets the ObjectId for the referenced Profile object.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 10.5.768.0

Syntax

C#
public override ObjectId ProfileId { get; }
Visual Basic
Public Overrides ReadOnly Property ProfileId As ObjectId
	Get
Visual C++
public:
virtual property ObjectId ProfileId {
	ObjectId get () override;
}

Remarks

This property returns an object id pointing to the referenced Profile object.

The referenced Profile object must be also referenced by the referenced Alignment object.

Examples

The following example uses a Baseline object, but it works the same for the ProfileId property of OffsetBaseline
CopyC#
 1private void WriteBaselineInfo(Baseline baseline)
 2{
 3    Alignment baselineAlignment = baseline.AlignmentId.GetObject(OpenMode.ForRead) as Alignment;
 4    Profile baselineProfile = baseline.ProfileId.GetObject(OpenMode.ForRead) as Profile;
 5
 6    // BaselineData is a sample helper class used to convert all the Baseline data
 7    // to strings and write them.
 8    // 
 9    BaselineData data = new BaselineData()
10    {
11        Name = baseline.Name,
12        StartStation = baseline.StartStation.ToString(),
13        EndStation = baseline.EndStation.ToString(),
14        AlignmentName = baselineAlignment.Name,
15        ProfileName = baselineProfile.Name,
16        BaselineType = baseline.BaselineType.ToString(),
17        // 'baseline.IsProcessed' has been deprecated. Use 'baseline.NeedsProcessing' instead.
18        NeedsProcessing = baseline.NeedsProcessing.ToString()
19    };
20
21    _writer.WriteBaselineInfo(data);
22
23    // Throws ArgumentException because start station cannot be beyond end station.
24    // baseline.StartStation = baseline.EndStation + 1.0; 
25
26    // Throws ArgumentException because end station cannot be before start station.
27    // baseline.EndStation = baseline.StartStation - 1.0;
28
29    // Throws ArgumentNullException because name cannot be null.
30    // baseline.Name = null;
31
32    // Throws ArgumentException because name cannot be empty after trimming leading and trailing blank characters.
33    // baseline.Name = " \n\r\t ";
34
35    foreach (BaselineRegion region in baseline.BaselineRegions)
36    {
37        WriteBaselineRegion(region);
38    }
39
40    // TODO: Should we include 'MainBaselineFeatureLines' here or do we need another example?
41    // TODO: Should we include 'OffsetBaselineFeatureLinesCol' here or do we need another example?
42
43    _writer.CloseBaselineInfo();
44}

See Also