Profile |
Exception | Condition |
---|---|
InvalidOperationException |
Thrown when:
|
ArgumentException |
Thrown when:
|
Supported bands: Horizontal Geometry band, Cant Data band.
For supported band:
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(...)
1// To set max offset distance to profile view band item. 2ObjectId alignment1Id, alignment2Id; 3// ... Get object id of alignment1 and alignment2. 4Alignment align = alignment1Id.GetObject(OpenMode.ForWrite) as Alignment; 5ObjectIdCollection viewIds = align.GetProfileViewIds(); 6ObjectId testViewId = viewIds[1]; 7ProfileView profileView = testViewId.GetObject(OpenMode.ForWrite) as ProfileView; 8ProfileViewBandItemCollection bottomBandItems = profileView.Bands.GetBottomBandItems(); 9ProfileViewBandItem banditem = bottomBandItems[2]; 10bandItem.Alignment2Id = alignment2Id; // For supported band, before setting max offset distance, set secondary alignment in advance. 11bandItem.MaxOffsetDistance = 100; // To clear max-offset-distance limit, set bandItem.MaxOffsetDistance to null. 12profileView.Bands.SetBottomBandItems(bandItems);
1// To store the return value of MaxOffsetDistance 2double? nullableDouble = bandItem.MaxOffsetDistance; // Method 1 to store the return value of MaxOffsetDistance. 3Nullable<double> nullableDouble2 = bandItem.MaxOffsetDistance; // Method 2 to store the return value of MaxOffsetDistance. 4if(nullableDouble.HasValue) 5{ 6 double value = nullableDouble.Value; 7} 8else 9{ 10 // Value is null. 11}