Table of Contents

Framing Joins

Control structural framing join behavior at beam endpoints with bulk operations on selected elements.

Overview

The Framing Joins tool provides two commands for managing structural framing joins in Revit:

  • Allow Join - Enables joins at both ends of selected structural framing elements
  • Disallow Join - Disables joins at both ends of selected structural framing elements

These commands operate on the current selection and modify the join behavior using Revit's StructuralFramingUtils API.

Source: src/Tools/Structural/FramingJoins/manifest.yml:1-26

Features

Allow Join Selected

Allows structural framing joins at both endpoints (index 0 and 1) of all selected framing elements.

Source: src/Tools/Structural/FramingJoins/Features/AllowJoinSelectedCommand.cs:16-18

Behavior:

  1. Retrieves the current selection from the active document
  2. Filters to only FamilyInstance elements in the OST_StructuralFraming category
  3. For each valid element, calls StructuralFramingUtils.AllowJoinAtEnd() for both endpoints
  4. Displays a summary alert showing the number of modified elements

Source: src/Tools/Structural/FramingJoins/Features/AllowJoinSelectedCommand.cs:29-84

Disallow Join Selected

Disallows structural framing joins at both endpoints (index 0 and 1) of all selected framing elements.

Source: src/Tools/Structural/FramingJoins/Features/DisallowJoinSelectedCommand.cs:16-18

Behavior:

  1. Retrieves the current selection from the active document
  2. Filters to only FamilyInstance elements in the OST_StructuralFraming category
  3. For each valid element, calls StructuralFramingUtils.DisallowJoinAtEnd() for both endpoints
  4. Displays a summary alert showing the number of modified elements

Source: src/Tools/Structural/FramingJoins/Features/DisallowJoinSelectedCommand.cs:29-84

Architecture

Project Structure

FramingJoins/
├── DBTools.Structural.FramingJoins.csproj
├── FramingJoinsToolModule.cs
├── manifest.yml
├── Assets/
│   ├── allow_join_icon.png
│   └── disallow_join_icon.png
└── Features/
    ├── AllowJoinSelectedCommand.cs
    └── DisallowJoinSelectedCommand.cs

Module Registration

The tool module is a simple marker class that inherits from DbtToolModule:

public sealed class FramingJoinsToolModule : DbtToolModule
{
}

Source: src/Tools/Structural/FramingJoins/FramingJoinsToolModule.cs:1-8

Command Availability

Both commands use the DbtStructuralFramingSelectionAvailability predicate, which requires at least one element from the OST_StructuralFraming category to be selected:

public sealed class DbtStructuralFramingSelectionAvailability : DbtSelectionAvailability
{
    protected override BuiltInCategory[]? RequiredCategories => 
        new[] { BuiltInCategory.OST_StructuralFraming };
}

Source: src/DBTools.App/Tools/Availability/DbtSelectionAvailability.cs:57-60

Transaction Handling

Both commands use CallGateTransactionRunner with ModalInlineCallGate for transaction execution:

var gate = new ModalInlineCallGate(context.UIApplication);
var tx = new DBTools.Core.Revit.Transactions.CallGateTransactionRunner(gate);
await tx.RunAsync(doc, "DB Tools - Allow Join Selected", d => { ... });

Source: src/Tools/Structural/FramingJoins/Features/AllowJoinSelectedCommand.cs:48-67

Error Handling

Individual element failures are caught and logged without stopping the batch operation:

catch (Exception ex)
{
    logger.LogDebug("[AllowJoin] Failed for element {ElementId}: {Message}", 
        RevitId.ToInt(elem.Id), ex.Message);
}

Source: src/Tools/Structural/FramingJoins/Features/AllowJoinSelectedCommand.cs:62-65

Settings

This tool has no configurable settings. It operates directly on the current selection.

Manifest

id: DBTools.Structural.FramingJoins
assembly: DBTools
moduleType: DBTools.Structural.FramingJoins.FramingJoinsToolModule
order: 0
tool:
  ribbonTools:
    - internalName: DBTools.AllowJoinSelected
      commandType: DBTools.Structural.FramingJoins.AllowJoinSelectedCommand
      availabilityType: DBTools.App.Tools.Availability.DbtStructuralFramingSelectionAvailability
      runProfile: InlineUi
      displayText: "Allow Join"
      iconBaseKey: allow_join
      tooltip: "Allow structural framing joins for selected elements"
      controlKind: SplitButtonItem
      splitGroup: framing_joins
      order: 0
    - internalName: DBTools.DisallowJoinSelected
      commandType: DBTools.Structural.FramingJoins.DisallowJoinSelectedCommand
      availabilityType: DBTools.App.Tools.Availability.DbtStructuralFramingSelectionAvailability
      runProfile: InlineUi
      displayText: "Disallow Join"
      iconBaseKey: disallow_join
      tooltip: "Disallow structural framing joins for selected elements"
      controlKind: SplitButtonItem
      splitGroup: framing_joins
      order: 1

Source: src/Tools/Structural/FramingJoins/manifest.yml:1-26

Manifest Properties

Property Value Description
id DBTools.Structural.FramingJoins Unique tool identifier
assembly DBTools Target assembly (merged into main DBTools assembly)
moduleType FramingJoinsToolModule DI module registration class
runProfile InlineUi Runs inline with UI context
controlKind SplitButtonItem Ribbon control type
splitGroup framing_joins Groups both commands under a single split button

Usage

  1. Select one or more structural framing elements (beams, braces, etc.)
  2. Click Allow Join or Disallow Join from the ribbon
  3. Review the summary dialog showing the number of modified elements

Dependencies

  • DBTools.Core - Core infrastructure, transactions, and UI services
  • ricaun.Revit.UI.Tasks - Async task execution in Revit context
  • Revit API (RevitAPI.dll, RevitAPIUI.dll)

Source: src/Tools/Structural/FramingJoins/DBTools.Structural.FramingJoins.csproj:35-44