|
6m
楼主 |
发表于 2010-9-24 17:56:40
|
只看该作者
放样
Private Sub CreateSweptBlend()
Try
'#Region "Create top and bottom profiles and path curve"
Dim pnt1 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0, 0, 0)
Dim pnt2 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(1, 0, 0)
Dim pnt3 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(1, 1, 0)
Dim pnt4 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0, 1, 0)
Dim pnt5 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0, 0, 1)
Dim arrarr1 As CurveArrArray = m_revit.Create.NewCurveArrArray()
Dim arr1 As CurveArray = m_revit.Create.NewCurveArray()
arr1.Append(m_revit.Create.NewLineBound(pnt1, pnt2))
arr1.Append(m_revit.Create.NewLineBound(pnt2, pnt3))
arr1.Append(m_revit.Create.NewLineBound(pnt3, pnt4))
arr1.Append(m_revit.Create.NewLineBound(pnt4, pnt1))
arrarr1.Append(arr1)
Dim pnt6 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0.5, 0, 0)
Dim pnt7 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(1, 0.5, 0)
Dim pnt8 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0.5, 1, 0)
Dim pnt9 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0, 0.5, 0)
Dim arrarr2 As CurveArrArray = m_revit.Create.NewCurveArrArray()
Dim arr2 As CurveArray = m_revit.Create.NewCurveArray()
arr2.Append(m_revit.Create.NewLineBound(pnt6, pnt7))
arr2.Append(m_revit.Create.NewLineBound(pnt7, pnt8))
arr2.Append(m_revit.Create.NewLineBound(pnt8, pnt9))
arr2.Append(m_revit.Create.NewLineBound(pnt9, pnt6))
arrarr2.Append(arr2)
Dim bottomProfile As SweepProfile = m_revit.Create.NewCurveLoopsProfile(arrarr1)
Dim topProfile As SweepProfile = m_revit.Create.NewCurveLoopsProfile(arrarr2)
Dim pnt10 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(5, 0, 0)
Dim pnt11 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(0, 20, 0)
Dim curve As Curve = m_revit.Create.NewLineBound(pnt10, pnt11)
Dim normal As Autodesk.Revit.DB.XYZ = Autodesk.Revit.DB.XYZ.BasisZ
Dim sketchPlane As Autodesk.Revit.DB.SketchPlane = CreateSketchPlane(normal, Autodesk.Revit.DB.XYZ.Zero)
'#End Region
' here create rectangular sweep blend
Dim newSweptBlend1 As SweptBlend = m_creationFamily.NewSweptBlend(True, curve, sketchPlane, bottomProfile, topProfile)
' move to proper place
Dim transPoint1 As Autodesk.Revit.DB.XYZ = m_revit.Create.NewXYZ(11, 32, 0)
m_familyDocument.Move(newSweptBlend1, transPoint1)
Catch e As Exception
m_errCount += 1
m_errorInfo += "Unexpected exceptions occur in CreateSweptBlend: " & e.ToString() & vbCr & vbLf
End Try
End Sub |
|