RevitCity.com Logo

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

Welcome !

775 Users Online (41 Members): Show Users Online - Most ever was 3914 - Wed, Aug 26, 2026 at 4:53:14 AM

 

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

When Revit grows up...

General Discussion >> Wishlist

Thu, Aug 7, 2014 at 10:49:16 AM

0

SKETCHUP FREELANCER AVAILABLE

Community >> The Studio

Thu, Jan 13, 2011 at 1:10:13 PM

0

How do you make theater with revit architecture 2011

Community >> The Studio

Sat, Nov 5, 2011 at 10:00:52 PM

2

Revit Architecture 2013 - Known Issues

Revit Building >> Technical Support

Fri, Apr 6, 2012 at 7:02:23 AM

0

Help with If then statement

Revit Building >> Technical Support

Tue, May 5, 2009 at 1:56:47 PM

9

Site Stats

Members:

2174253

Objects:

23399

Forum Posts:

152397

Job Listings:

0

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.8649

Login

User Name:

Password:

Remember Me  

Forgot Password?

Search Forums

Advanced Search

Search Forums

Advanced Search


Clear Highlights


Clear Highlights