AlignPartByConnectors Method


Moves fabrication part by one of its connectors and aligns it to another connector.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2016

Syntax

C#
public static bool AlignPartByConnectors(
	Document document,
	Connector connector,
	Connector toConnector,
	double axisRotation
)
Visual Basic
Public Shared Function AlignPartByConnectors ( _
	document As Document, _
	connector As Connector, _
	toConnector As Connector, _
	axisRotation As Double _
) As Boolean
Visual C++
public:
static bool AlignPartByConnectors(
	Document^ document, 
	Connector^ connector, 
	Connector^ toConnector, 
	double axisRotation
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document.
connector
Type: Autodesk.Revit.DBConnector
The connector of the fabrication part to move and align by.
toConnector
Type: Autodesk.Revit.DBConnector
The connector of the fabrication part or family to align to.
axisRotation
Type: SystemDouble
Rotation around the direction of connection - angle between width vectors in radians.

Return Value

True if alignment succeeds, false otherwise.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException For rectangular and oval parts the axis rotation must be a multiple of PI/2. -or- The connector does not belong to a fabrication part. -or- The fabrication part is connected.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

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 →