FamilyInstance CreateBeam(
FamilySymbol familySymbol,
Level level,
XYZ startPt,
XYZ endPt)
{
StructuralType structuralType
= StructuralType.Beam;
//Line line = _doc.Application.Create.NewLineBound( startPt, endPt ); // 2013
Line line = Line.CreateBound( startPt, endPt ); // 2014
FamilyInstance beam = _doc.Create
.NewFamilyInstance( startPt, familySymbol,
level, structuralType );
LocationCurve beamCurve
= beam.Location as LocationCurve;
if( null != beamCurve )
{
beamCurve.Curve = line;
}
return beam;
}