ProfileViewBandItemMaxOffsetDistance Property

Gets or sets the max offset distance.

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

Property Value

NullableDouble
Exceptions
ExceptionCondition
InvalidOperationException Thrown when:
  • The band type is not supported.
  • The band type is supported band and secondary alignment hasn't been set.
ArgumentException Thrown when:
  • The band type is supported band and new value is less than 0.
Remarks

Supported bands: Horizontal Geometry band, Cant Data band.

For supported band:

  • Max offset distance should be greater than or equal to 0.
  • To clear max-offset-distance limit, set MaxOffsetDistance to null.
  • For existing supported band on profile view, its default value is 10; for supported band newly added to profile view, its default value is 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#
 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);
C#
 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}
See Also