ConnectAndCouple Method


Makes a connection between the specified connectors and adds coupling if necessary.

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

Syntax

C#
public static bool ConnectAndCouple(
	Document doc,
	Connector partConn,
	Connector toConn
)
Visual Basic
Public Shared Function ConnectAndCouple ( _
	doc As Document, _
	partConn As Connector, _
	toConn As Connector _
) As Boolean
Visual C++
public:
static bool ConnectAndCouple(
	Document^ doc, 
	Connector^ partConn, 
	Connector^ toConn
)

Parameters

doc
Type: Autodesk.Revit.DB Document
The document.
partConn
Type: Autodesk.Revit.DB Connector
The connector of the fabrication part.
toConn
Type: Autodesk.Revit.DB Connector
The connector of the fabrication part or family to connect to.

Return Value

True if connection succeeded, false otherwise.

Remarks

This function does not place and align the fabrication part. Call AlignPartByConnectors before connecting.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The connector does not belong to a fabrication part. -or- The fabrication part connectors are not aligned, call AlignPartByConnectors to align them.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL

See Also