Element Binding in Revit

Agreed, thanks Jacob!

1 Like

Thank you for the explanation and example.

As someone still learning Python to make my own custom Nodes. This is the behaviour I can influence by the .ToDSType(false/true) method if I’m not mistaken?

Sorry for the late reply - that is correct from my experience (though I attempt to stay out of Python nodes unless they are nested in a custom node - helps to keep things scaling correctly).

Hi Jacob,

First of all, I want to thank and congratulate you for providing such a detailed post on how all this works. I know a little about element binding, and I now understand better some of the issues around this I have run into in the past.

Quick question, in the third paragraph, you write:

Do you mean Revit’s UI, or Dynamo’s default UI?

Thanks,
Joe

1 Like

I did! Editing now.

Thanks for the proof reading. :slight_smile:

1 Like

Made a PowerShell script to remove all the bindings in .dyn files. It searches all .dyn files in current folder and subfolders, and if it has any bindings it will remove them and save a copy with “_NoBindings” appended to the original filename.
File size of the .dyn goes up a bit because of PS adding extra spaces/tabs when re encoding to json but not a big deal (to get script size back to normal, open in Dynamo, save and close).

I may try to do a Python version if people find this useful.

7 Likes

And about the Bindings data in “No Element Binding.dyn” after running and saving , the NodeId points to node “Wall.ByCurveAndHeight”, and the large non-readable value is a SOAP message (kinda XML) which was encoded in Base64 and had 4 more nested SOAPs in it, also Base64 encoded. See image for full “human readable” format.
I can only imagine the struggle for Dynamo to encode/decode all the bindings and nested stuff in complex scripts… Deserialising all this stuff on the fly surely explains some performance issues and bottlenecks.

PS. The Robot Overlords said hi :slight_smile:

3 Likes

Just figured that adding -Compress to the ConvertTo-Json command in line 7 gets rid of spaces and tabs and file size bloat.

2 Likes

I’ll check this out and see if I can make sense of it and get it to work. Thank you

5 posts were split to a new topic: Dynamo Player for Revit - Input Adjustments

Check out what @john_pierson did to explain it. Crystal clear.

10 Likes

Jacob, thank you for your post, I really appreciate the technical explanation.

Glad it helped. For further info feel free to attend my AU course this year. The encore presentation on Thursday had openings last I checked.

Attended your AU Session on this last month and just found a chance to use and saved me a bunch of time! thank you so much @JacobSmall !!

4 Likes

Thank you. it took me 3 days to figure this out, i was having trouble with views.
Every time i run the script, it just deleted the previous ones…

Hi @JacobSmall,
I try to reproduce your example provided with the additional class materials from your AU class about element bindings. Can you please share the custom nodes you have used in the graph as well?


Thank you :slight_smile:

I don’t have that handy and they’re not of much value beyond this exercise so I have no plans on publishing a package for this. However, reproducing the same graph is less important than producing other versions you will need in the future, so knowing how to build your own version of each is a must.

Towards that end, those were just the same nodes in the associated type wrapping in a custom node. So the Elemwnt_Bindings-OOTBoxNodesWrapped is just a custom node made from the FamilyInstance.ByPoint node.

It gets a bit fuzzy at the end (ie: custom node inside a custom node passing through a python node), but give it a shot to reproduce what you can - it’ll help when there is a change in the behaviors someday. I’ll try to remember to post an expanded data set here next week when I have access to that dataset again.

2 Likes

Interesting to know how this works exactly…
Dynamo really should have a switch to turn bindings on and off in the active script, for when you DO want to create new elements each time.
In the meantime, would it possible to make ‘Clear Binding’ node that if used in a .dyn will will clear out all the binding data from the active .dyn before or after each run?

Not likely. You would need to change the way the Dynamo works holistically so likely a modification to Dynamo would be required. Many ‘bad things’ could stem from altering this though so be careful as you look into it.

Ok, thanks. Ill just stick to using the player for this then.