I am having difficulty rotating an instance of a concrete pipe so that it slopes correctly in profile. My VB.NET program reads an xml file of Manhole and Pipe information, loads the appropriate families and then places the manholes and pipes into a Revi project. The pipes come in correctly when looking at them in plan view, connecting from manhole to manhole, but in profile view the pipes are flat and not sloped. I beleive the problem could be one of two issues; either I am not defining the axis line to rotate the pipe around correctly, or, the pipe family instance has something set in there that prevents the pipe from sloping. I am new to both VB.NET and Revit, so any improvements to my code will be greatly appreciated!!! This code is in a subroutine and is only partial code 'Load the pipe family Dim FamilyfileName As String = "C:\Documents and Settings\All Users\Application Data\Autodesk\RAC 2010\Imperial Library\Storm - MEC\Reinforced Concrete Pipe.rfa" Dim FamilyTypeName As String = "24"" Reinforced Concrete Pipe" Dim symbol As Autodesk.Revit.Symbols.FamilySymbol = Nothing m_doc.LoadFamilySymbol(FamilyfileName, FamilyTypeName, symbol) 'now read the structure array list to find the beginning and end of the current pipe Dim i As Integer = 0 Dim j As Integer = 0 For i = 0 To structInfo.Count - 1 For j = 0 To structInfo(i).Count - 1 If structInfo(i).Item(j).ToString = PipeName Then 'see if this is the beginning or end of the pipe If structInfo(i).Item(j - 1).ToString = "out" Then StartX = structInfo(i).Item(2) StartY = structInfo(i).Item(3) StartZ = structInfo(i).Item(j - 2) ElseIf structInfo(i).Item(j - 1).ToString = "in" Then EndX = structInfo(i).Item(2) EndY = structInfo(i).Item(3) EndZ = structInfo(i).Item(j - 2) End If End If Next Next 'Set the Start and End points for the pipe Dim StartXYZ As XYZ = m_doc.Application.Create.NewXYZ(StartX, StartY, StartZ) Dim EndXYZ As XYZ = m_doc.Application.Create.NewXYZ(EndX, EndY, EndZ) Dim instance As Autodesk.Revit.Elements.FamilyInstance = m_doc.Create.NewFamilyInstance(StartXYZ, symbol, StructuralType.NonStructural) Dim line1 As Line = m_doc.Application.Create.NewLineBound(StartXYZ, EndXYZ) Angle = Angle * Math.PI / 180 'Angle is passed into this sub routine m_doc.Rotate(instance, line1, Angle) Thanks, Mike
|