Gets or sets the max offset distance.
Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.280
Syntax
C#
public double? MaxOffsetDistance { get; set; }
VB
Public Property MaxOffsetDistance As Double? Get Set
C++
public: property Nullable<double> MaxOffsetDistance { Nullable<double> get (); void set (Nullable<double> value); }
Property Value
NullableDoubleExceptions
Exception | Condition |
---|---|
InvalidOperationException |
Thrown when:
|
ArgumentException |
Thrown when:
|
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
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}