ProfileViewBandItemAlignment2Id Property

Gets or sets the object id of alignment2.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public ObjectId Alignment2Id { get; set; }

Property Value

ObjectId
Exceptions
ExceptionCondition
InvalidOperationException Thrown when:
  • The band type is not supported.
ArgumentException Thrown when:
  • The band type is supported band and new value is the primary alignment of the profile view.
  • For Cant Data band, Alignment2 doesn't support cant.
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
C#
 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);
See Also