How to delete multiple parameters from families

I’m attempting to batch remove a set of parameters from all families in a project. I’ve search for topics here but nothing I find works for me.

The below seems to remove the parameter I feed in by the string but its not doing the same for the code block. Thats one part I can’t figure out, what I’m also not sure of is how to load the family back into the project. By that I mean, when I run the script and open the family, parameters are removed (when using the string method), however the family in the project still has the parameter(s).

Project parameter? Shared parameter? Family parameter?

For the most part, just find the Id of the internal parameter in the project and delete as if it is any other element. Note that that may break your family depending on what the parameter is used for.

If you open and save the family after that - the parameter will be gone.

I think this is a function of how Orchid is dealing with background opened documents, as you can’t iterate over them effectively via the built in lacing and list levels. I do not recommend processing files like this; it’s exponentially slower and less effective overall.

They are all family parameters, just text based ones so no risk of breaking the family.

Are you saying that I can force remove the parameters for each family from the project environment?

If I understand it right, I can only remove one parameter per transaction? Thats why the codeblock with further parameters wouldn’t remove anything?

What would be a better method of dealing with the families and removing the parameters than what I was trying?

Hello @BJozi here is something there probably can help…but i would say if you have many files i would do it with birdtool or BVN…as is more stable i think :wink:

Revit_xBSAq04RUy

1 Like

Bird tools MultiPlayer, manually running on each family, or utilizing Python to open each document and perform the actions before saving and closing.

1 Like

Hi Sovitek, I couldn’t quite follow your gif (couldn’t pause it). Is the below correct/the same as what you had?

I do have a warning on the familydocument.deleteparameter node:
Warning: FamilyDocument.DeleteParameter operation failed.
A sub-transaction can only be active inside an open Transaction.

When I open the family the parameter is gone but change is not being loaded into the project.

I hadn’t heard of Birdtools, I see jacob.small also mentions it so I downloaded it. I’ll have to look into it further as I can’t just see how it works or is any different to what I am doing above.

I’m hoping to start a python course next month, hopefully get something out of it I can apply/use in Dynamo in the not to faraway future!

Not really sure…try set your lacing to shortest in "family document delete…

The benefit with Bird Tools Multiplayer is that you write the graph to work on one family, and it runs said graph on N families - meaning you don’t have to worry about background opening documents anymore.

Yes thats best in my opinion :wink:

1 Like

I’ll try changing the graph later on and run it again.

I will have to run a similar script on our library of families, which I could try use Birdtools for.

I’m not sure how to deal with families already loaded into our template which I want to delete parameters from, they exist in the library but I can’t be certain all families point to the library version (so I can’t reliably reload). I also don’t want to load the whole library into our template.

I could export all families in the template and then run Birdtools on all files and reload them back into the template but I will lose the file path to our library if I do this.

I would get the family names (not the types), check if the name is in the library, and load it in.

You don’t want content in the template that isn’t in the library anyway, or the first time a user has to load the content in you’ll have conflicting data.

1 Like