System curtain panel face problem

Anonymous

System curtain panel face problem

Anonymous
Not applicable

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.

Capture.PNG

Any help or comment is appreciated. I could give a reproducible case if needed

0 Likes
Reply
Accepted solutions (1)
409 Views
2 Replies
Replies (2)

Anonymous
Not applicable
Accepted solution

Solved on my own. The problem was in the geometry of the panel I was extracting.

I was using "getInstanceGeometry" instead of "getSymbolGeometry". Instance geometry as written in the article is a copy of geometry and you cannot put anything on these faces. Article below

https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/CloudHelp/cloudhelp/2014/EN...

0 Likes

Ning_Zhou
Advocate
Advocate

hi MartynasBlinstrubis, how did you get top face of curtain panel?