AlignPartByConnector Method


Align the part by its connector to a point and rotation in free space.

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

Syntax

C#
public static bool AlignPartByConnector(
	Document document,
	Connector connector,
	XYZ position,
	double rotation,
	double rotationPerpendicular,
	double slope,
	FabricationPartJustification justification,
	Transform trf
)
Visual Basic
Public Shared Function AlignPartByConnector ( _
	document As Document, _
	connector As Connector, _
	position As XYZ, _
	rotation As Double, _
	rotationPerpendicular As Double, _
	slope As Double, _
	justification As FabricationPartJustification, _
	trf As Transform _
) As Boolean
Visual C++
public:
static bool AlignPartByConnector(
	Document^ document, 
	Connector^ connector, 
	XYZ^ position, 
	double rotation, 
	double rotationPerpendicular, 
	double slope, 
	FabricationPartJustification justification, 
	Transform^ trf
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document.
connector
Type: Autodesk.Revit.DBConnector
The connector to align in free space.
position
Type: Autodesk.Revit.DBXYZ
The position to move the connector to.
rotation
Type: SystemDouble
The rotation in radians.
rotationPerpendicular
Type: SystemDouble
The perpendicular rotation for free placement around the Y axis direction of connection - angle in radians.
slope
Type: SystemDouble
The slope value to flex to match if possible in fractional units (eg.1/50). Positive values are up, negative are down. Slopes can only be applied to fittings, whilst straights will inherit the slope from the piece it is connecting to.
justification
Type: Autodesk.Revit.DB.FabricationFabricationPartJustification
The justification to align eccentric parts.
trf
Type: Autodesk.Revit.DBTransform
Optional alignment transformation matrix, eg. a Trf that describes plan or side elevation.

Return Value

True if the alignment succeeds, false otherwise.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The connector does not belong to a fabrication part. -or- The fabrication part is connected.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException 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 →