AlignByFace Method


It will copy the source rebars, will align them to the destination face based on the source face and adapt them to destination host.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since: 2023

Syntax

C#
public static ISet<ElementId> AlignByFace(
	Document doc,
	IList<Rebar> sourceRebars,
	Reference sourceFaceReference,
	Reference destinationFaceReference
)
Visual Basic
Public Shared Function AlignByFace ( _
	doc As Document, _
	sourceRebars As IList(Of Rebar), _
	sourceFaceReference As Reference, _
	destinationFaceReference As Reference _
) As ISet(Of ElementId)
Visual C++
public:
static ISet<ElementId^>^ AlignByFace(
	Document^ doc, 
	IList<Rebar^>^ sourceRebars, 
	Reference^ sourceFaceReference, 
	Reference^ destinationFaceReference
)

Parameters

doc
Type: Autodesk.Revit.DB Document
A document.
sourceRebars
Type: System.Collections.Generic IList Rebar
The rebars that will be propagated. All of them must be from the same host as the source face reference.
sourceFaceReference
Type: Autodesk.Revit.DB Reference
A reference to a face in the source host.
destinationFaceReference
Type: Autodesk.Revit.DB Reference
A reference to a face in the destions host.

Return Value

The newly created rebars.

Remarks

The source and destination hosts represented by the source and destination references can be the same element or can be difereent elements. They can also be of different categories

The destination host must be able to host rebar.

The source rebars should not be gourp members.

This method uses its own transaction, so it's not permitted to be invoked in an active transaction.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The element that contains the destinationFaceReference is not a valid rebar host. -or- The rebars should be from the same host as the source face reference. -or- The rebars that are group members can't be propagated. -or- The references should represent faces that have same type of surface. -or- The source and destination face references should be different. -or- This method uses its own transaction, so it's not permitted to be invoked in an active transaction.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also