Element Binding causing problems

I’m having major problems with Element Binding.
I’ve got a graph that creates a new Level and all of the different Views (Floor Plan, Demo plan, Furniture Plan, etc) that we need for that Level.
The problem is that if I run it twice, it deleted the Level it created in the first run, and changes it to what should have been the second value.
a.) Because of Element Binding, it makes it extremely difficult to debug
b.) I though that running it through the Player forced it to NOT use element binding, but I’m seeing the same thing happen in the UI and in the Player. Plus, running in the Player - see a.)

I really need to force my graph to never use Binding. But I don’t know if that’s poissible

Hi @DaveP

Good Explanation by @JacobSmall in this topic:

And also by @john_pierson video:

2 Likes

Clearing out the bindings from the saved file should resolve the issue. If they exist when run via player things will get moved/deleted/updated though.

How does one “clear out the bindings”?
I did manage to save the model, close out of everything and restart and the Player worked.
I’ve seen several Twitter threads on this topic & I’d also like to comment that I’d love for the Element Binding to be an option rather than being baked in.
As I mentioned, the Binding makes it really difficult to debug. Especially when the Player behaves differently than the UI.
There is very little I do with Dynamo where I require Binding.
Thanks for listening

1 Like

Should have known that @john_pierson would have an answer. :face_with_monocle:
I had seen Jacob’s thread but not John’s video.Thanks for that link

1 Like

As per that other post:

Open the .dyn in a text editor. Find the section dedicated to bindings. Delete the stuff in that part of the json file. Save the file with an appended name (incase you deleted too much), and then open it in Dynamo Player. Previously created content shouldn’t be removed.

When you wrote the graph that made the levels, and then the views, did you hit undo in Revit after each run of the graph? Or did you wind up with multiple copies of the levels at the same location?

If the answer to both of those is ‘no’ then you used Element Binding and you didn’t even know it. The feature which puts the data into the file for future use is the same feature which keeps you from getting duplicate element creation on each run. They are two sides of the same coin in this way. The end users leveraging Dynamo Player are the only ones who truely don’t need it, but they aren’t able to update previously created elements, so they are missing out there.

For AU I’m proposing an element binding presentation (one of five I’m considering) to go over this stuff in detail. If it gets accepted and developed I’ll be sure to post on it.

1 Like

Element binding is great during graph creation/testing but when a graph is complete it can be a hindrance. I am sure this gets brought up often but is it possible for there to be a button next to the Run button that is essentially the equivalent of going into the text editor and removing the binding section, to basically bake in what was made after the run? Wherever in the Dynamo code where bindings are saved to just clear out that property? I don’t know if that would be something difficult to do.

Currently the alternative is saving the graph before running and then quitting the graph without saving to run it again or to do as you said and open up as a .txt. The problem with the first is that I often have people running scripts and accidentally saving them after run (‘force of habit’) so I would have to go and clear out their bindings for them. Some projects are in 2016 or 2017 still with Dynamo player not being available (at least not natively for 2017).

I do remember you mentioning about being able to make a Dynamo graph that would clear out bindings on another graph which is another alternative though.

It sounds so simple, but that’s a pretty big overhaul as I see it, impacting the way Dynamo works not just with the Revit integration, but also Civil 3D, Formit, Advance Steel, Fusion, Alias… I’ll talk to the team tomorrow (or Tuesday if the right people aren’t around).

1 Like

@DaveP, if you’re interested in voting for the AU class I submitted on this topic, it’s called “Getting the Good Stuff out of Pandora’s Box: Element Binding In Dynamo for Revit” and you can vote for it by searching for “element binding” here:

Coming back to this a year later (and with pretty much the same problem.

Jacob, I found your excellent AU presentation.
I’m now trying to replicate the graph you made to strip out the bindings
But something is wrong with my graph & I think it’s because there’s some formatting I could get exact from your PDF.
I suspect I’ve got something wrong in one or both of the “String” nodes
Or maybe the Code Block. I get null coming out of that
Any chance you could upload the .dyn?
Here’s mine:
RemoveBindings.dyn (16.7 KB)

Thanks

1 Like

Oddly enough your graph worked just fine off the shelf for me. Can you take a screenshot of the errors for me?

My gut says that the file you’re removing the bindings from is formatted for Dynamo 1.x and therefore wont’ have the same markers as the graph currently uses, so A[2] will error out in that code block. Can you confirm the graph you’re removing bindings from is formatted for Dynamo 2.x? A String.StartsWith node looking for "{" would do the trick and could be used to trigger a UI indicating an incorrect version for the tool.

Thanks for the quick reply!
I added a bunch of Watch nodes so you can see what I’m getting. It looks like the String.Split breaks the file into 2 pieces. I’d expect three. Then the Code Block returns null. That I’m assuminmg is because of the a[2] which doesn’t exist
Here’s a screen shot


and the graph I was operating on (it currently does not have any Bindings)
Add a Level.dyn (479.6 KB)

It would be amazing if there was a “turn-binding on / off” button with dynamo.

There are several threads on the forum about that exact topic.