構造物を作成する

構造物は、マンホール、排水ます、集排水口などの物理的なオブジェクトを表します。論理的には、構造物はパイプとパイプ終点の間の接続として使用されます。2 つのパイプが直接接続されている場合でも、物理オブジェクトを表さない AeccStructure オブジェクトがジョイントとして作成されます。 1 つの構造物に任意の数のパイプを接続できます。構造物は AeccStructure 型のオブジェクトによって表されます。このオブジェクトは、AeccPipeNetworkSurfaces コレクションの Add メソッドを使用して作成します。

次の例では、パーツ リストで見つかった最初の構造物ファミリとサイズ フィルタを使用して、そのパーツ タイプに基づいて新しい構造物を作成します。

Dim oStructure as AeccStructure
Dim oSettings As AeccPipeSettingsRoot
Dim oPartLists As AeccPartLists
Dim oPartList As AeccPartList
Dim sStructureGuid As String
Dim oStructureFilter As AeccPartSizeFilter
 
' Go through the list of part types and select the first
' structure found.
Set oSettings = oPipeDocument.Settings
' Get all the parts list in the drawing.
Set oPartLists = oSettings.PartLists
' Get the first part list found.
Set oPartList = oPartLists.Item(0)
For Each oPartFamily In oPartList
   ' Look for a structure family that is not named
   ' "Null Structure".
   If (oPartFamily.Domain = aeccDomStructure) And _
     (oPartFamily.Name = "Null Structure") Then
      sStructureGuid = oPartFamily.guid
      ' Get the first size filter list from the family.
      Set oStructureFilter = oPartFamily.SizeFilters.Item(0)
      Exit For
   End If
Next
 
Dim dPoint(0 To 2) As Double
dPoint(0) = 100: dPoint(1) = 100 
 
' Assuming a valid AeccNetwork object "oNetwork".
Set oStructure = oNetwork.Structures.Add( _
  sStructureGuid, _
  oStructureFilter, _
  dPoint, _
  5.2333) ' 305 degrees in radians