Hi,
I need help in placing a family in the project.
Thanks & Regards
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.
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;
}
}