More Transaction Start and End Questions

Hi friends,

I am attempting to troubleshoot a crash event in a Dynamo graph I have built. I would assume a transaction.end and transaction.start node would resolve the issue, but it is not.

I am using the Rhythm node Elements.SetParameterByNameTypeOrInstance to set type based parameter values for a series of unique Revit elements that have been placed into a project:

If I run the graph as is, it crashes Revit and Dynamo.

If I freeze the Elements.SetParametersByNameTypeOrInstance, run the graph, unfreeze this node, and run the graph again, the graph works without issue.

This holds true with or without the Transaction.End and Start nodes that I have added in. But my assumption was that the act of placing elements, then changing their type values was causing some sort of illegal operation order, so I added in the transaction end and start to emulate starting and stopping the graph. However, it has no effect and the crash event persists unless I freeze the node then unfreeze.

My question is, what is the difference between freezing/unfreezing and running the graph twice vs a transaction.start transaction.end? Is this an order of operations issue within the Dynamo environment and data instead?

Rhythm uses the built-in setParameter methods in Dynamo, so I am not too sure why you are running into issues. Also you should not need to add any transaction nodes to it.

Here is the source code for that node:

All it does is:

  1. Look for the parameter as instance first and set it if found.
  2. If that wasn’t found try to set it as a type parameter.

One question I have is, do you know what kind of parameter you are targeting? Type or Instance?

(If you know, then you should use the OOTB SetParameter node to set the instance or the OOTB SetParameter node with Element.ElementType for type parameters)

1 Like

Thanks for responding! Originally there were to be both Instance and Type based parameters, but I simplified it to work exclusively with Type parameters. I just tried it with the OOTB method and it experiences the same crash event.

I remain puzzled that my transaction end and start nodes seem to have no effect here…

Well. An update: This graph is built in 2.04 and Revit 2019 (and unfortunately must stay in 2019…). Evaluating the graph, nothing jumps out as obviously wrong, so I decided to see what happens when run in 2.6 and R2021. Works without issue.

Well I burned an entire day exploring this but I finally figured it out and gained some valuable knowledge in the rabbit holes I went down. In retrospect, I should have thought of the solution way sooner… Dynamo sure can humble you!

An overview of the original operation: load family, place a single instance of every family type, modify parameter data for every family type.

An overview of the solution: Load family, modify parameter data for every family type, place a single instance of every family type.

2 Likes