Element Binding in Revit

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.

Thanks @jacob.small for the great explanation!

1 Like

What version of Rhythm has the Helpers.ToggleElementBinder node?
I have Rhythm 2019.1.21 but I cannot find this node.

Hi @Revit_Noob you are using a 2 years late version of Rhythm.

  1. Try downloading a new version first
  2. and make a new topic in the forum.

I cannot install higher version of rhythm as I only have this dynamo version installed :

Dynamo Core 2.0.2.6826
Dynamo Revit 2.0.2.6833

@Revit_Noob that shouldn’t be an issue. Please try and install the latest version. @john_pierson builds its nodes in such a way that you should be good to go with Revit 2018+ et Dynamo anything above 2.0 version

Not all nodes will work in Revit 2018 i think. :slight_smile:

@Marcel_Rijsmus obviously not all because of Revit API new features such as the warnings access for example. but most of them will.

1 Like

also, @Revit_Noob , the helper was created in april 2019, whereas your specific version of the package is older.


therefore :grin:

1 Like

Ok will try. Thank you.

Unfortunately none of these work for me. I have a script which selects the edges of of elements and turns it to a poly curve which forms the path for the sweep of a family profile. This is then inserted into the project by direct shape. This procedure has to be repeated many times over, but every time it creates a the sweep at the new location only. I have literally tried everything including saving as different rvt files. but nothing works. I have even tried flush bindings from monocle. No use.

  1. Clear the bindings via monocle, and save and close the graph.
  2. Check to confirm bindings are clear by opening the file in a text editor and confirming nothing rests under the “Bindings” section of the file (watch the AU class for more info)
  3. Only run the graph via Dynamo Player once you confirm the bindings are clear.

This will ensure that each time you hit run new elements are created, while the old ones are left in place. Running by standard Dynamo is also possible if you close the file without saving between pressing ‘run’.

A final option which I didn’t cover is building and using a function for the element creation efforts. This wasn’t covered before because it’s more complex and would require another hour or so to get into the intricacies. I’ll add it to the list of stuff to cover in a future Dynamo Office Hour though.

If you can’t make any of these work start a new topic and attach an RVT and your current DYN.

3 Likes

Thank you for the quick response. It is working now. One mistake I was making was not changing the name of the element between runs. The direct shape was created using brepshape which is a springs node which requires a name to be provided for the created element. I also used the toggle mentioned in one of the posts here. Now it is working without editing the text file. Thank you.

2 Likes

Thanks @jacob.small, for a big article on Element Binding. The removal of Bindings section works for me today after hunting a solution for an hour.

1 Like

Hey guys,

I also made two handy scripts to auto-delete the bindings in .dyn files. You need to create one .bat and one .ps1 file. So a Batch and a PowerShell-File.
The Batch-File executes the PowerShell-File on double-click. The PowerShell-File deletes all Bindings in all .dyn files wihtin the same folder where the ps1 is located. Do not rename both files as the names are being referred in the code unless you know how to change the code accordingly. So the easiest way is to copy both files into the same folder where your .dyn files are located and just double click the .bat.
Attention: Be aware that you maybe have to allow execution of PowerShell-Scripts on your machine. Otherwise the PowerShell-Script won’t execute.

The Filenames (incl. extensions) are:

“ExecutePowerShell.bat” and “PS_Script_DeleteBindingsInDynamoFile.ps1”

Here is the Code for the .bat:

@ECHO OFF
SET ThisScriptDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptDirectory%PS_Script_DeleteBindingsInDynamoFile.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'";

Here is the Code for the .ps1:

$path = $MyInvocation.MyCommand.Path
$path = Split-Path $path -Parent
$files = Get-ChildItem -Path $path -Filter *.dyn
<#
ForEach ($file in $files){
    If ($file.Name.Contains("new")){
        Remove-Item -Path $file.FullName
    }
}
#>
$files = Get-ChildItem -Path $path -Filter *.dyn
ForEach ($file in $files){
    #$NewName = $file.FullName -replace ".dyn", "_new.dyn"
    #Copy-Item -path $file.FullName -Destination $NewName
    (Get-Content -Path $file.FullName -Raw) -replace "(?ms)Bindings.*?]", "Bindings`": []" |
    Set-Content -Path $file.FullName  
}

7 Likes