RevitCity.com Logo

Home  |  Forums  |  Downloads  |  Gallery  |  News & Articles  |  Resources  |  Jobs  |  FAQ  |  SearchSearch  |  Join  |  LoginLogin

Welcome !

71 Users Online (70 Members): Show Users Online - Most ever was 626 - Mon, Jan 12, 2015 at 2:00:17 PM

 

Forums

Forums >> Workflow & Implementation >> API & Third Party Apps >> Rotate an Instance in Profile View using VB.NET

Search this ThreadSearch this Thread | Page 1 of 1 |

Mon, Jul 6, 2009 at 10:22:49 AM | Rotate an Instance in Profile View using VB.NET

#1

MCotreau


active

Joined: Sat, Jun 27, 2009
1 Posts
No Rating


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



This user is offline

 

Search this ThreadSearch this Thread | Page 1 of 1 |



Similar Threads

Thread/Thread Starter

Forum

Last Post

Replies

Profile Family (Can't create instance)

Community >> Newbies

Wed, Oct 21, 2009 at 11:39:04 AM

2

Rotate beam profile

Revit Building >> Technical Support

Thu, Jul 7, 2005 at 4:33:06 PM

1

Instance profile parameters?

Revit Structure >> Technical Support

Fri, Nov 6, 2009 at 2:43:12 PM

10

Shortcut Key to Rotate 3D View

Revit Building >> Technical Support

Wed, Dec 1, 2010 at 4:06:52 PM

7

Component rotate

General Discussion >> Wishlist

Tue, Feb 8, 2011 at 10:55:46 AM

2

Site Stats

Members:

1993947

Objects:

22882

Forum Posts:

152185

Job Listings:

3

Sponsored Ads

Home | Forums | Downloads | Gallery | News & Articles | Resources | Jobs | Search | Advertise | About RevitCity.com | Link To Us | Site Map | Member List | Firm List | Contact Us

Copyright 2003-2010 Pierced Media LC, a design company. All Rights Reserved.

Page generation time: 0.9822

Login

User Name:

Password:

Remember Me  

Forgot Password?

Search Forums

Advanced Search

Search Forums

Advanced Search


Clear Highlights


Clear Highlights