建议正确重载 NewFamilyInstance

Suggest correct overload of NewFamilyInstance

建议我可以在我的案例中使用的 NewFamilyInstance 重载。

我写了一个方法,使用这两个重载将一些元素添加到墙的 Finish[1] & Finish[2] 层:

  1. public FamilyInstance NewFamilyInstance(XYZ location,
                                            FamilySymbol symbol,
                                            StructuralType structuralType)
    
  2. public FamilyInstance NewFamilyInstance(XYZ location,
                                            FamilySymbol symbol,
                                            Wall wall,
                                            StructuralType structuralType)
    

对于水平的墙(如果我们从顶视图看墙)它工作正常,但对于特定角度的墙,元素保持水平。

我附上了代表上述两种情况的图片。

这是我使用的重载

foreach (double layerOffsett in layerOffsets )
{
    int counter = 0;
    oldStartPoint = p0 + layerOffsett * vectoPerpendicularTothewall;

    FamilyInstance instance2 = document.Create.NewFamilyInstance(
                                   oldStartPoint, 
                                   symbol,
                                   wall,
                                   StructuralType.NonStructural);

    for (int j = 1; j < n2 - 1; j++)
    {
        XYZ newStartPoint = new XYZ(oldStartPoint.X + 4
                                        * normalizeVectorAlongTheWall.X,
                                    oldStartPoint.Y + 4
                                        * normalizeVectorAlongTheWall.Y,
                                    oldStartPoint.Z + 4
                                        * normalizeVectorAlongTheWall.Z);

        instance2 = document.Create.NewFamilyInstance(
                        newStartPoint,
                        symbol,
                        wall,
                        StructuralType.NonStructural);

        oldStartPoint = newStartPoint;
    }

    counter++;
}

我放置的元素未托管到墙上。

我希望这些元素在墙壁的 Finish 层中自动旋转并自行调整。

有什么办法或者我必须单独旋转它们吗?

检查此 resource

您可以插入族实例并旋转与墙相同的角度。