P

AnalyticalModelSurface.ProjectionZ

Description:
The Z projection option.
Remarks:
Retrieves and set analytical model projection information for Z direction. To set projection to level, grid or plane use ProjectionPlaneZ property.
public SurfaceElementProjectionZ ProjectionZ { get; set; }
/// <summary>
/// Change the Z projection for all surface elements to BottomOrExterior
/// </summary>
public void ChangeSurfaceProjections(Document document)
{
    FilteredElementCollector collector = new FilteredElementCollector(document);
    IList<Element> elements = collector.WherePasses(new ElementClassFilter(typeof(AnalyticalModelSurface))).WhereElementIsNotElementType().ToElements();
    if (elements.Count > 0)
    {
        using (Transaction tran = new Transaction(document, "Change Surface Projections"))
        {
            tran.Start();
            foreach (AnalyticalModelSurface ams in elements)
            {
                SurfaceElementProjectionZ orgEndProj = ams.ProjectionZ;
                SurfaceElementProjectionZ newEndProj = SurfaceElementProjectionZ.BottomOrExterior;
                ams.ProjectionZ = newEndProj;
            }
            tran.Commit();
        }
    }
}