# Dynamo to Revit transaction failing

**URL:** <https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612>\
**Category:** Revit\
**Tags:** revit, python, dynamo\
**Created:** [December 21, 2021, 5:58pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612 "2021-12-21T17:58:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_SchmiWi](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@Luca\_SchmiWi](https://forum.dynamobim.com/u/Luca_SchmiWi)\
**Post date:** [December 21, 2021, 5:58pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/1 "2021-12-21T17:58:33Z")

</div>

Hello,

I tried all day to solve a weird problem but I simply can’t find a solution.  
I am trying to create multiple roofs which are shaped by points. The user inputs are ModelCurves as the top of the roof outline and RoofTypes. The script than creates

- a planar outline at the bottom of the roofs
- a level at the bottom of the roofs
- control points for the shape

Afterwards it creates the roofs, changes the shape by the given points and saves the element ID’s as a parameter

The script works as intended until I create a custom node out of it. When I use it as custom node the elements get created as intended (judging by the output values) but they never show up in Revit. Furthermore if I try to select the elements by ID outside of the custom node flow they aren’t found.

Does anybody have an idea how to solve that?

CustomNode:

 ![CustomNode](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/c/5c401235cb64a92928f9aadfdf6e66107d1a2066.png)  
 ![CustomNode-Detail](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/3165581e2b929fcc674befbd32e8fb634f4220ef.png)

Testing CustomNode:

 ![CustomNode-Test](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/0/e091adf52faca46579092533265a59e93143d5ed.png)

Expected result created without CustomNode:

 ![ExpectedResult without CustomNode](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/2/d222fdb77e39e3716de301f7ec51d423e2378bb5.png)  
[CustomNode.dyf](https://forum.dynamobim.com/uploads/short-url/cZRhtcf7LGiJvHuFIYUhQ3VawpR.dyf) (113.7 KB)  
[Test-CustomNode.dyn](https://forum.dynamobim.com/uploads/short-url/n8rRLn7dibNYMOVibLelp3LeRfl.dyn) (21.8 KB)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 21, 2021, 6:19pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/2 "2021-12-21T18:19:18Z")

</div>

A Transaction.End node maybe needed here.  
The Roof needs to be created first before you can access their ID.

---

<div class="post-metadata">

**Author:** ![Luca\_SchmiWi](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@Luca\_SchmiWi](https://forum.dynamobim.com/u/Luca_SchmiWi)\
**Post date:** [December 21, 2021, 8:10pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/3 "2021-12-21T20:10:01Z")

</div>

Thanks for the hint. I tried that. Now I see the elements for a short amount of time after running the script. Afterwards they somehow get deleted again.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 21, 2021, 8:40pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/4 "2021-12-21T20:40:33Z")

</div>

Here i need an expert.  
@jacob.small

---

<div class="post-metadata">

**Author:** ![Luca\_SchmiWi](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@Luca\_SchmiWi](https://forum.dynamobim.com/u/Luca_SchmiWi)\
**Post date:** [December 21, 2021, 8:47pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/5 "2021-12-21T20:47:02Z")

</div>

Funnily enough I can undo the “deletion” step in Revit and get my roofs.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 21, 2021, 9:11pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/6 "2021-12-21T21:11:45Z")

</div>

Did you ever thought about element binding?  
Or can you skip that as a possibility?

---

<div class="post-metadata">

**Author:** ![Luca\_SchmiWi](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@Luca\_SchmiWi](https://forum.dynamobim.com/u/Luca_SchmiWi)\
**Post date:** [December 21, 2021, 9:28pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/7 "2021-12-21T21:28:24Z")

</div>

Thought about that aswell but ElementBinding is disabled both in the CustomNode and in the script. I used the Node from the Rhythm package for that. Tried w/o binding toogled off aswell but didnt’t work either.

I placed the Transaction.End node at the very end of the CustomNode and changed the flow so there are no parallel procedures for the roof elements.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 21, 2021, 9:37pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/8 "2021-12-21T21:37:29Z")

</div>

OK. back to the beginning  
What does the error say?

---

<div class="post-metadata">

**Author:** ![Luca\_SchmiWi](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@Luca\_SchmiWi](https://forum.dynamobim.com/u/Luca_SchmiWi)\
**Post date:** [December 21, 2021, 9:44pm UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/9 "2021-12-21T21:44:50Z")

</div>

I dont’t have an error anymore. At the beginning it was a non valid element ID because the transaction didn’t end.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 22, 2021, 1:17am UTC](https://forum.dynamobim.com/t/dynamo-to-revit-transaction-failing/71612/10 "2021-12-22T01:17:44Z")

</div>

I believe that once you pack it into a custom node binding is reintroduced, no matter how you manage it inside the node.

By the sounds of it you are going to be best served by breaking this into a few custom nodes. One to make the initial shape and one to do the edits.
