Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

insert family

1 REPLY 1
Reply
Message 1 of 2
sanjaymann
808 Views, 1 Reply

insert family

Hi,

 

I need help in placing a family in the project.

 

Thanks & Regards

1 REPLY 1
Message 2 of 2
R.van.den.Bor
in reply to: sanjaymann

Hi there,

 

There are many ways to place a family since there are several types of families. Jeremy spent several topics about it, so I would say that's a nice place to start.

Jeremy's blog

 

You can also take a look in the revit api reference guide. The sample below shows how to place a door family in a wall.

 

void CreateDoorsInWall(Autodesk.Revit.DB.Document document, Wall wall)
{
String fileName = @"C:\Documents and Settings\All Users\Application Data\Autodesk\RST 2011\Imperial Library\Doors\Single-Decorative 2.rfa";
Family family = null;
if (!document.LoadFamily(fileName, out family))
{
throw new Exception("Unable to load " + fileName);
}
// get the active view's level for beam creation
Level level = document.ActiveView.Level;
FamilySymbolSetIterator symbolItor = family.Symbols.ForwardIterator();
double x = 0, y = 0, z = 0;
while (symbolItor.MoveNext())
{
FamilySymbol symbol = symbolItor.Current as FamilySymbol;
XYZ location = new XYZ(x, y, z);
FamilyInstance instance = document.Create.NewFamilyInstance(location, symbol, wall, level, StructuralType.NonStructural);
x += 10;
y += 10;
z += 1.5;
}
}

 

Kind regards,
Remy van den Bor
ICN Solutions B.V.
Liked this post or found it usefull, don't forget the Kudo It won't hurt (at least not me).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community