AlignByHost Method


It will copy the source rebars, will align them in the same way as how the source host is aligned to destination host and will adapt them to the destinaion 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> AlignByHost(
	Document doc,
	IList<Rebar> sourceRebars,
	Element destinationHost
)
Visual Basic
Public Shared Function AlignByHost ( _
	doc As Document, _
	sourceRebars As IList(Of Rebar), _
	destinationHost As Element _
) As ISet(Of ElementId)
Visual C++
public:
static ISet<ElementId^>^ AlignByHost(
	Document^ doc, 
	IList<Rebar^>^ sourceRebars, 
	Element^ destinationHost
)

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.
destinationHost
Type: Autodesk.Revit.DB Element
The destination host where the new rebar will be created.

Return Value

The newly created rebars.

Remarks

The source and destination hosts should be of the same category.

The source and destination hosts should be different elements.

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 There are no source rebars to propagate. -or- The rebars should be from the same host. -or- The rebars that are group members can't be propagated. -or- destinationHost is not a valid rebar host. -or- The source and destination hosts should be of the same category. -or- The source and destination hosts must be different elements. -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