RevitCity.com Logo

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

Welcome !

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

 

Forums

Forums >> Community >> Newbies >> Create.NewFamilyInstance isn't displaying a new family on sheet

Search this ThreadSearch this Thread | Page 1 of 1 |

Mon, May 9, 2011 at 1:06:22 PM | Create.NewFamilyInstance isn't displaying a new family on sheet

#1

zzz88


active

Joined: Fri, May 6, 2011
4 Posts
No Rating


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'm trying to display a new family on a sheet.  It doesn't display.  How do I do that?  This is my sample code:

 

Public Function Execute(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData, ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Autodesk.Revit.UI.Result Implements Autodesk.Revit.UI.IExternalCommand

.Execute

 

Dim fileName As String =

"C:\Users\cpo\my documents\titleblock.rfa"

 

TaskDialog.Show("Title"

, fileName.ToString)

m_rvtUIApp = commandData.Application

 

TaskDialog.Show(m_rvtUIApp.ToString, ""

)

m_rvtUIDoc = m_rvtUIApp.ActiveUIDocument

 

TaskDialog.Show(m_rvtUIDoc.ToString, ""

)

m_rvtApp = m_rvtUIApp.Application

 

TaskDialog.Show(m_rvtApp.ToString, ""

)

m_rvtDoc = m_rvtUIDoc.Document

 

TaskDialog.Show(m_rvtDoc.ToString, ""

)

 

 

 

 

 

Dim family As Family = Nothing

If Not m_rvtDoc.LoadFamily(fileName, family)

Then

 

Throw New Exception("Unable to load "

+ fileName)

 

End

If

 

TaskDialog.Show(family.ToString, ""

)

 

Dim symbolItor As FamilySymbolSetIterator

= family.Symbols.ForwardIterator()

 

Dim x As Double = 0, y As Double

= 0

 

While

symbolItor.MoveNext()

 

Dim symbol As FamilySymbol = TryCast(symbolItor.Current, FamilySymbol

)

 

Dim location As New Autodesk.Revit.DB.XYZ

(x, y, 10)

 

 

Dim instance As Autodesk.Revit.DB.FamilyInstance = m_rvtDoc.Create.NewFamilyInstance(location, symbol, Autodesk.Revit.DB.Structure.StructuralType

.NonStructural)

 

TaskDialog.Show(symbol.ToString, ""

)

x += 10

 

End

While

 

Return Result

.Succeeded

 

End

Function


This user is offline

 

Search this ThreadSearch this Thread | Page 1 of 1 |



Similar Threads

Thread/Thread Starter

Forum

Last Post

Replies

Numerate 'Sheet Number' parameter for match line family

Revit Building >> Technical Support

Mon, Apr 28, 2014 at 10:17:51 AM

7

Sheet in Family

Revit Building >> Technical Support

Wed, Jan 30, 2008 at 9:18:57 AM

1

unchecking 'greyed out' revisions on sheet

Revit Structure >> Technical Support

Fri, Jan 21, 2022 at 2:54:02 PM

11

Sheet # of 'total number of sheets'

Revit Building >> Tips & Tricks

Fri, Nov 16, 2007 at 6:59:54 AM

6

windows in elevation and 3d not displaying correctly

Revit Building >> Technical Support

Thu, Oct 6, 2016 at 9:15:31 AM

3

Site Stats

Members:

2057170

Objects:

23074

Forum Posts:

152250

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: 1.6333

Login

User Name:

Password:

Remember Me  

Forgot Password?

Search Forums

Advanced Search

Search Forums

Advanced Search


Clear Highlights


Clear Highlights