The Z projection option.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.2.0.0)
Since:
2015
Syntax
Remarks
Examples
CopyC#
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();
}
}
}
CopyVB.NET
Public Sub ChangeSurfaceProjections(document As Document)
Dim collector As New FilteredElementCollector(document)
Dim elements As IList(Of Element) = collector.WherePasses(New ElementClassFilter(GetType(AnalyticalModelSurface))).WhereElementIsNotElementType().ToElements()
If elements.Count > 0 Then
Using tran As New Transaction(document, "Change Surface Projections")
tran.Start()
For Each ams As AnalyticalModelSurface In elements
Dim orgEndProj As SurfaceElementProjectionZ = ams.ProjectionZ
Dim newEndProj As SurfaceElementProjectionZ = SurfaceElementProjectionZ.BottomOrExterior
ams.ProjectionZ = newEndProj
Next
tran.Commit()
End Using
End If
End Sub
Exceptions
See Also