Transaction Start and End

I have a large definition that consists of two major parts. I want to be able to run part 1 and finish this before the script cycles through part 2, as without this break in transaction part 2 fails. I am trying to place the transaction.start and transaction.end node but am having difficulty understanding what should be wired and where. Has anyone successfully used these nodes before?

I’m not familiar with the Transaction nodes (what package or daily build is this?) but could you achieve the same thing using the Boolean Switch node (Boolean Switch package)?

You could “dam” the data at the Boolean Switch node by initially running the graph with the bool input set to False and then toggle it to True for your second run.

The wombat is back!

The transaction nodes are in built nodes. Make sure you are running dynamo with Revit, as they fall under revit>transaction. Maybe they only refer to revit transactions then but I guess my script is running revit transactions. I considered using a Boolean toggle through an IF node which will work similar to how you describe Brian, but I thought I would open this up to see if anyone has made use of the transaction nodes as they confuse me!!

oic. Yes I’d be interested in hearing about how they work, too

Do you have an example of what you are trying to achieve?

This is a super basic example but i think you literally tie everything to transaction.end. That way the next portion will begin after it is done.

2015-08-10_13h16_41

Capture

 

 

 

 

So in my example I want to place a family at given points and then check to see what view its in. Obviously if this script is run at the same time it checks the views before the family has been placed and therefore returns an empty list. For this method to work I need to run the green bit first and then the orange bit. However as you can see there is no clear position to pass the transaction nodes to.

mark, just wire the transaction.end to the transaction.start and transaction.start to list.sublistcontain

that should work.

 

Hi Mark,

I presume the python scripts extracts all the visible elements in the view? If so, try connecting the output of the “Transaction.End” node to a dummy input on the python node. In Dynamo a node will not initiate until all inputs are computed.

I can’t remember the last time I needed a “Transaction.Start” node because Dynamo’s global transaction manager has become very adequate and can predict very well if a node needs to be run inside a transaction.

Peter I had tried that as it made seemed to make sense but this also returned a null value.

Dimitar that has worked perfectly!! This has been my only ever need for it but it would seem passing it through a python node either with or without code seems to give me what I need.

Gentlemen,

If I understand correctly, if you have two inputs into a dummy node, dynamo waits until both are finished before continuing.
But how do you make a dummy node…I need to wait until the list.map is finished before continuing, but i need the data that also goes into the list.map

Capture

 

 

 

how do i get this to work. do i need transaction or a dummy node?

The easiest ways I have found to order execution in Dynamo are to use Function.Compose, or to use Custom Nodes or use them together!

Function.compose works nicely because it evaluates each function in order from top to bottom. If you need to transact you put a transact.end inside the custom nodes that you are composing.

A Begin or ordered execution like construct would be useful for this work though.

 

1 Like

Hi all,

I was trying to use both the dummy node and transactions End & Start but there is clearly something I’m not quite understanding. I’d greatly appreciate it if you could clarify the process.

Say we want to do the following:

  1. Count existing materials in a project

  2. Delete all materials (@Konrad_K_Sobon Archi-lab package)

  3. Count materials again

As you can see the last count node is still displaying the same number of materials we have at the beginning.

Thanks!!!

1 Like

you would need something different all together doc.Regenerate() what happens is that even if the transaction was committed, unless document was regenerated (I am assuming it wasn’t) then your count won’t update. You can try to force it to regen by plugging output of Delete Elements into Transaction.End and then from that you have to collect the Materials again which is what you are doing.

1 Like

Maybe temporarily drop the materials to excel for a scratchpad, stop your transaction, the start it again from an Import from the excel file? I have a script that I had to do this on, simply because the time to write to excel wasn’t pausing the script. When the data was being read back into Dynamo it would be blank asExcel wasn’t done thinking.

Thanks @Konrad_K_Sobon.

With your explanation, I understand Dynamo perform its tasks onto the Document as is in the very moment we click Run. Still, I couldn´t make it work. Unfortunately Python scripting are beyond my skills.

Hi @Jason_Parker, actually the process I am working on reads the Project Finishes Schedule in Excel and creates those materials in Revit, setting the Mark parameter. If a material gets deleted or a Mark modified in Excel, it would update that information in Excel. It looks like this:

So far works fine, though being able to stop and start certain nodes would make it a totally robust process.

Thanks again!

@Mark_Thorley1 and @Dimitar_Venkov, Hi both:

I know that this is quite old, but could you post how the “Dummy Python” is connected to the script to work?

Thanks!

1 Like