AutoCAD Civil
3D UI tools allows us to add or remove Baseline in a Corridor object as shown
in the screenshot below –
In Civil 3D
2014 .NET API, BaselineCollection class has new functionality to add and remove
Baseline object as shown in the screenshot below and the relevant C# code
snippets –
// BaselineCollection.Add()
// Adds a baseline with the given baseline name, alignment Id and profile Id.
// Get the first alignment of this drawing
ObjectId alignmentId = civilDoc.GetAlignmentIds()[0];
Alignment alignment = trans.GetObject(alignmentId, OpenMode.ForRead) as Alignment;
// Get the first profile of this alignment
ObjectId profileId = alignment.GetProfileIds()[0];
// Add the baseline
Baseline baseline = corridor.Baselines.Add("My Added BaseLine", alignmentId, profileId);
// Remove baseline with a given Name
corridor.Baselines.Remove("Baseline (1)");
Hope this is
useful to you !


Leave a Reply