AlignPartByConnectorToConnector Method
Align a part by its connector to another connector. This will replace the FabricationPart::AlignPartByConnectors method.

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

Syntax

C#
public static bool AlignPartByConnectorToConnector(
	Document document,
	Connector connector,
	Connector fixedConnector,
	double rotation,
	double slope,
	FabricationPartJustification justification
)
Visual Basic
Public Shared Function AlignPartByConnectorToConnector ( _
	document As Document, _
	connector As Connector, _
	fixedConnector As Connector, _
	rotation As Double, _
	slope As Double, _
	justification As FabricationPartJustification _
) As Boolean
Visual C++
public:
static bool AlignPartByConnectorToConnector(
	Document^ document, 
	Connector^ connector, 
	Connector^ fixedConnector, 
	double rotation, 
	double slope, 
	FabricationPartJustification justification
)

Parameters

document
Type: Autodesk.Revit.DB..::..Document
The document.
connector
Type: Autodesk.Revit.DB..::..Connector
The connector of the fabrication part to move by in free space.
fixedConnector
Type: Autodesk.Revit.DB..::..Connector
The connector for the fabrication part or family connector to align to.
rotation
Type: System..::..Double
The rotation in radians.
slope
Type: System..::..Double
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.Fabrication..::..FabricationPartJustification
The justification to align eccentric parts.

Return Value

True if the alignment succeeds, false otherwise and the part will not move from the original position.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentException 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.Exceptions..::..ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

See Also