# Splicing rebars issue

**URL:** <https://forum.dynamobim.com/t/splicing-rebars-issue/115266>\
**Category:** Developers\
**Tags:** revit, python\
**Created:** [October 9, 2026, 6:59pm UTC](https://forum.dynamobim.com/t/splicing-rebars-issue/115266 "2026-10-09T18:59:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![REDO10](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@REDO10](https://forum.dynamobim.com/u/REDO10)\
**Post date:** [October 9, 2026, 6:59pm UTC](https://forum.dynamobim.com/t/splicing-rebars-issue/115266/1 "2026-10-09T18:59:18Z")

</div>

Hi All, @c.poupin

Using the attached script, I’m trying to create longitudinal rebars (`top_rebar` and `btm_rebar`) and stirrups for each beam in an intersecting beam network.

After creation, the longitudinal rebars should be constrained to the stirrups and stacked vertically so that they do not overlap or penetrate each other at intersection points or **supports**. This is ensured by checking whether a beam is oriented as **“principal”** (`dir_flag == True`) or **“secondary”** (`dir_flag == False`).

The longitudinal rebars must then be spliced using **splice\_rebar()** whenever their length exceeds **12.00 m**.

I initially tested `splice_rebar()` in a separate script that only creates the longitudinal rebars (`top_rebar` and` btm_rebar`) for each beam. In this test, I deliberately omitted the stirrups, so no stacking rules were applied. All rebars were spliced as expected.

However, when I ran the main script, in which `splice_rebar()` is called as the final step after the rebars have been successfully constrained, I noticed that only the longitudinal rebars (`top_rebar` and `btm_rebar`) belonging to **“secondary”** beams (`dir_flag == False`) were successfully spliced.

For the rebars belonging to **“principal”** beams (`dir_flag == True`), splicing fails, and an **empty list** is returned for these rebars, as shown in the output below, even though `result.Error == RebarSpliceByRulesError.Success` for all rebars, and this is confirmed by the second output below.

 ![splice_results](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/c/dc3b6c8ee79bd2d20fbc797505c8a5179ab17a71.png)

```auto
Python Script: spliced rebar Id is:520415
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520416
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520417
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520418
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520419
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520420
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520421
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520422
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520423
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520424
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520425
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520426
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520427
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520428
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 2
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520429
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520430
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520431
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________
Python Script: spliced rebar Id is:520432
Python Script: result for splice rebar is: Success
Python Script: splice geometries count is: 1
Python Script: __________________________________________________

```

I’m therefore having trouble identifying the root cause of this behavior!?

Please check the attached script and Revit model below:  
**Remark** : The script is too long to post here due to the forum’s character limit, so please refer to the attached file

[new\_beams\_spliced\_rebars.py](https://forum.dynamobim.com/uploads/short-url/2aD9xneQANsQ5Hw3vfDmCRc3kzx.py) (34.6 KB)

[splice\_rebars\_beams\_network.rvt](https://forum.dynamobim.com/uploads/short-url/hLUtKVts2C6pAv6krhNJi85rFR4.rvt) (2.6 MB)

Any help would be greatly appreciated.

Thanks in advance!
