ProjectionZ Property


The Z projection option.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2015

Syntax

C#
public SurfaceElementProjectionZ ProjectionZ { get; set; }
Visual Basic
Public Property ProjectionZ As SurfaceElementProjectionZ
	Get
	Set
Visual C++
public:
property SurfaceElementProjectionZ ProjectionZ {
	SurfaceElementProjectionZ get ();
	void set (SurfaceElementProjectionZ value);
}

Remarks

Retrieves and set analytical model projection information for Z direction. To set projection to level, grid or plane use ProjectionPlaneZ property.

Examples

Copy C#
/// <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();
        }
    }
}

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentOutOfRangeException When setting this property: A value passed for an enumeration argument is not a member of that enumeration

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →