切土と盛土を計算する

コリドー サーフェスの重要な用途の 1 つは、それらを既存の現況地盤サーフェスと比較することです。これにより、計画コリドーに合わせて地形を変更するために必要な切土と盛土の量を決定します。AeccCorridorSurface オブジェクトと AeccSurface オブジェクトを一緒に使用してこのような統計情報を計算することはできませんが、各 AeccCorridorSurface オブジェクトは同名の AeccSurface オブジェクトを持ちます。

次の例では、既存の現況地盤とコリドーの計画サーフェスの差異から土量サーフェスを作成し、切土、盛土、および土量の統計を計算します。

' Get the collection of all surfaces in the drawing.
Dim oSurfaces As AeccSurfaces
Set oSurfaces = oRoadwayDocument.Surfaces
 
' Assign the setup information for the volume
' surface to be created.
Dim oTinVolumeCreationData As New AeccTinVolumeCreationData
oTinVolumeCreationData.Name = VOLUME_SURFACE_NAME
Dim sLayerName as String
sLayerName = oRoadwayDocument.Layers.Item(0).Name
oTinVolumeCreationData.BaseLayer = sLayerName
oTinVolumeCreationData.Layer = sLayerName
Set oTinVolumeCreationData.BaseSurface = oSurfaces.Item("EG")
' Get the surface with the same name as the corridor surface.
Set oTinVolumeCreationData.ComparisonSurface = oSurfaces.Item(oCorridorSurface.Name)
oTinVolumeCreationData.Style = oSurfaces.Item("EG").StyleName
oTinVolumeCreationData.Description = "Volume surface of corridor"
 
' Create a volume surface that represents the
' difference between the two surfaces.
Dim oTinVolumeSurface As AeccTinVolumeSurface
Set oTinVolumeSurface = oSurfaces.AddTinVolumeSurface(oTinVolumeCreationData)
 
' Get information about the volume surface and
' display it in a messagebox.
Dim dNetVol As Double
Dim dCutVol As Double
Dim dFillVol As Double
dNetVol = oTinVolumeSurface.Statistics.NetVolume
dCutVol = oTinVolumeSurface.Statistics.CutVolume
dFillVol = oTinVolumeSurface.Statistics.FillVolume
MsgBox "Net Volume = " & dNetVol & " cu.m" & _
  vbNewLine & "Cut = " & dCutVol & " cu.m" & _
  vbNewLine & "Fill = " & dFillVol & " cu.m", _
  vbOKOnly, _
  "Differences between """ & _
  oTinVolumeCreationData.BaseSurface.Name & _
  """ and """ & _
  oTinVolumeCreationData.ComparisonSurface.Name & _
  """"