パイプ オブジェクトは、パイプ ネットワークの配管を表します。パイプは、パイプ ネットワークの AeccPipeNetwork.Pipes コレクションを使用して作成します。 このコレクションは、直線パイプまたは曲線パイプのいずれかを作成するためのメソッドを備えています。どちらのメソッドでも、特定のパーツ ファミリ(ファミリの GUID を使用)と特定のパーツ サイズ フィルタ オブジェクトに加え、パイプの始点と終点を指定する必要があります。始点と終点の順序は、流れの向きの定義において意味を持つ場合があります。
次の例では、パーツ リストで最初に発見したパイプ ファミリとパイプ サイズ フィルタを使用して、2 つのハードコードされたポイント間に直線パイプを作成します。
Dim oPipe as AeccPipe Dim oSettings As AeccPipeSettingsRoot Dim oPartLists As AeccPartLists Dim oPartList As AeccPartList Dim sPipeGuid As String Dim oPipeFilter As AeccPartSizeFilter ' Go through the list of part types and select the first ' pipe 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 pipe family. If (oPartFamily.Domain = aeccDomPipe) Then sPipeGuid = oPartFamily.guid ' Get the first size filter list from the family. Set oPipeFilter = oPartFamily.SizeFilters.Item(0) Exit For End If Next Dim dStartPoint(0 To 2) As Double Dim dEndPoint(0 To 2) As Double dStartPoint(0) = 100: dStartPoint(1) = 100 dEndPoint(0) = 200: dEndPoint(1) = 100 ' Assuming a valid AeccNetwork object "oNetwork". Set oPipe = oNetwork.Pipes.Add(sPipeGuid, oPipeFilter, dStartPoint, dEndPoint)