Identify elements created with Dynamo

There has been lots of previous discussion about element binding, that is, when Dynamo deletes/modifies previously created elements. I understand this info is stored in the Dynamo file, not the Revit file (which is actually different to how Dynamo works with other Autodesk products). But I’m wondering if there is a way to reference into Dynamo, elements that have been previously created by Dynamo.

The scenario is, I’m creating annotations - dimensions, tags, etc. I want to be able to delete all previously created elements before re-running the script as some of the creation methods use Python and the element is non-binding (that is, they get duplicated). Originally I though I could use a shared parameter as an identified but shared parameters only works on model elements, not annotations. I also can’t use a detailed group as some of the items are dimensions.

Any ideas if this is possible?


Hi @Paul_Wintour,
Here’s my thoughts.
When you create a new element in Revit, it receives an id value. If you were to somehow keep track of the id values from your last dynamo run, they could be used as a reference to delete the elements. You could try exporting a text file, or maybe there’s a better way to do this with python. Hopefully, that can get things started.

In the past I used a ‘modified by dynamo’ parameter to store a date-time value which I just slapped on after some create/modify nodes. This made it easy to ‘back check’ work as I went along.

This data could instead be written to an external database, where each entry has a user ID, a date-time value, a model GUID, a model path, and a list of element GUIDs (not using element IDs as GUIDs are more stable long term, which this would be). Might even be able to write that up as an extension if you were so inclined.

There may be a way to pull the data out of the dyn directly (via element binding), but that only works if you save the dyn after running it, so it wouldn’t work in a dynamo player situation or with office standard graphs marked as read only.

The ‘modified by dynamo’ parameter will only work on model elements right, not annotations?

I think writing to an external files might be more trouble than its worth. At least in this case.

Yeah, most of the time this script will be run via Dynamo Player so that’s not an option either.