Gets or sets the object id of alignment2.
Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.280
Syntax
C#
public ObjectId Alignment2Id { get; set; }
VB
Public Property Alignment2Id As ObjectId Get Set
C++
public: property ObjectId Alignment2Id { ObjectId get (); void set (ObjectId value); }
Property Value
ObjectIdExceptions
Exception | Condition |
---|---|
InvalidOperationException |
Thrown when:
|
ArgumentException |
Thrown when:
|
Remarks
Supported bands: Horizontal Geometry band, Cant Data band.
For supported band, Alignment2Id is secondary alignment. To cancel setting secondary alignment, set Alignment2Id to ObjectId.Null.
When creating profile view(s), this property is not supported to set. We can set this property after profile view(s) have been created. How to create profile view(s), refer to ProfileView.Create(...) or ProfileView.CreateMultiple(...)
Example
1ObjectId alignment1Id, alignment2Id; 2// ... Get object id of alignment1 and alignment2. 3Alignment align = alignment1Id.GetObject(OpenMode.ForWrite) as Alignment; 4ObjectIdCollection viewIds = align.GetProfileViewIds(); 5ObjectId testViewId = viewIds[1]; 6ProfileView profileView = testViewId.GetObject(OpenMode.ForWrite) as ProfileView; 7ProfileViewBandItemCollection bottomBandItems = profileView.Bands.GetBottomBandItems(); 8ProfileViewBandItem banditem = bottomBandItems[2]; 9bandItem.Alignment2Id = alignment2Id; 10profileView.Bands.SetBottomBandItems(bandItems);