Note: This API is now obsolete.
[ObsoleteAttribute("This method is deprecated in Revit 2026 and may be removed in a later version of Revit. Prefer updateCustomConnectionType instead.")]
public static void AddElementsToCustomConnection(
StructuralConnectionHandler structuralConnectionHandler,
IList<Reference> references
)| Exception | Condition |
|---|---|
| ArgumentException | Input StructuralConnectionHandler must have custom type. -or- All the input Elements should be of the following structural categories: framings, columns, profiles, plates, bolts, anchors, shear studs, welds or structural connections. -or- Total number of different input elements of input StructuralConnectionHandlers must be lower or equal to 3. |
| ArgumentNullException | A non-optional argument was null |
// Select elements to add to connection. IList<Reference> refs = Utilities.Functions.SelectConnectionElementsCustom(activeDoc); if (refs.Count() <= 0) { return Result.Failed; } // Start transaction trans.Start(); // Adding the elements to the custom connection, using Revit's StructuralConnectionHandlerType class StructuralConnectionHandlerType.UpdateCustomConnectionType(conn, refs, []); // Commit the transaction ts = trans.Commit(); if (ts != TransactionStatus.Committed) { message = "Failed to commit the current transaction !"; trans.RollBack(); return Result.Failed; } }