PPT_LOGO_4b
Revit Programming Introduction <#>
Copyright © 2009 Autodesk Inc.
部屋境界をイタレート
»Dim boundaries As BoundarySegmentArrayArray = room.Boundary
»Dim boundary As BoundarySegmentArray
»Dim iB As Integer = 0
»For Each boundary In boundaries
»  iB += 1
»  sMsg += vbCrLf & "  Boundary " & iB & ":"
»  Dim iSeg As Integer = 0
»  Dim segment As BoundarySegment
»  For Each segment In boundary
»    iSeg += 1
»    Dim crv As Geometry.Curve = segment.Curve
»    If TypeOf crv Is Geometry.Line Then           ' LINE
»      Dim line As Line = crv
»      Dim ptS As XYZ = line.EndPoint(0)
»      Dim ptE As XYZ = line.EndPoint(1)
»      sMsg += vbCrLf & "    Segment " & iSeg & " is a LINE:" & _
»       ptS.X & ", " & ptS.Y & ", " & ptS.Z & " ; " & _
»       ptE.X & ", " & ptE.Y & ", " & ptE.Z
»    ElseIf TypeOf crv Is Geometry.Arc Then        ' ARC
»      Dim arc As Arc = crv
»      Dim ptS As XYZ = arc.EndPoint(0)
»      Dim ptE As XYZ = arc.EndPoint(1)
»      Dim r As Double = arc.Radius
»      sMsg += vbCrLf & "    Segment " & iSeg & " is an ARC:" & _
»       ptS.X & ", " & ptS.Y & ", " & ptS.Z & " ; " & _
»       ptE.X & ", " & ptE.Y & ", " & ptE.Z & " ; R=" & r
»    End If
»  Next
»Next
lab5-3-1
ジオメトリーとグループ
RoomクラスのプロパティにBoundaryが存在します、その中の各セグメントを取得します。
これが部屋の境界となります。