Profile |
Exception | Condition |
---|---|
InvalidOperationException |
Thrown when:
|
ArgumentException |
Thrown when:
|
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(...)
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);