コリドーに基線を追加する

BaselineCollection クラスで、Add() メソッドを使用して、コリドーに新しい基線を追加することができます。このメソッドは 2 種類あります。1 つは、新しい Baseline の名前、AlignmentObjectIdProfileObjectId を指定します。もう 1 つは、新しい Baseline の名前、Alignment の名前、Profile の名前を指定します。

次の例では、名前で選択されたコリドー、およびドキュメントの最初の線形とその線形内の最初の縦断を使用して、基線を作成します。

// use on a document with at least one alignment, and one profile for the alignment
// EG: Corridor-5b.dwg in the tutorials directory
string corridorName = "Corridor - (1)";
Corridor corridor = ts.GetObject(_civildoc.CorridorCollection[corridorName], OpenMode.ForWrite) as Corridor;

// Get the ObjectId of an alignment and profile
ObjectId alignmentId = _civildoc.GetAlignmentIds()[0];
Alignment alignment = ts.GetObject(alignmentId, OpenMode.ForRead) as Alignment;
ObjectId profileId = alignment.GetProfileIds()[0];

Baseline baseline = corridor.Baselines.Add("New Baseline", alignmentId, profileId);