Good day,
I have faced a serious problem with placing a line based or face based family instance on system panel top face.
Below I added a small snippet from code. Top face is extracted from panel geometry. Every parameter looks fine while debugging (face normal, placement coordinate etc.) but after placing, best case scenario new family instance is flying somewhere in the project or is not placed at all (input line does not belong to face).
This code works like a charm on any other solids like floors, footprintroofs etc.
FamilySymbol profileSymbol = EmacFamilySymbol.GetFamilySymbolByName(doc
, "Roof profile face"
, BuiltInCategory.OST_GenericModel);
using (Transaction trans=new Transaction(doc,"test"))
{
trans.Start();
profileSymbol.Activate();
if (projectedPoints.Count == 2)
{
Line projectedLine = Line.CreateBound(projectedPoints.First()
, projectedPoints.Last());
XYZ dir = projectedLine.Direction;
FamilyInstance faceInstance = doc.Create.NewFamilyInstance(topFace
, projectedLine.Evaluate(0.5, true)
, new XYZ(1, 0, 0)
, profileSymbol);
FamilyInstance lineInstance = doc.Create.NewFamilyInstance(topFace
, projectedLine
, profileSymbol);
}
trans.Commit();
}
What I want to do is simply to place a family instance on face (line based or face based). For me, it seems that something is wrong with the face of system panel, not sure.
Any help or comment is appreciated. I could give a reproducible case if needed
Solved! Go to Solution.