Hi I have several family documents in a directory, I am trying to first filter them based on the category and a paramater, In the second step I am trying to add shared parameters to these families.
The script shows no errors but the issues arise, when I check the output. When I open the families it gives me the following error and the parameters are not added.
After I close it and re-open, I can see that the parameters are added. But If I dont save the file it reverts back to the previous version without the parameters.
I highly recommend avoiding the opening of files in the background with rhythm or orchid and just use the OOTB nodes to do this on a document by document basis.
This video gives an overview of how to batch simpler graphs over a directory.
Sounds good. Re: orchid the author prefers you ask about his package over on github, but either way good luck with the graph! Perhaps others can chime in here as well.
I only looked at the first image but it looks like you:
Open the FamilyDocuments and filter for specific category
Load those Families and filter FamilyTypes by parameters
Get the FamilyDocuments back from the FamilyTypes
Add shared parameters to the FamilyDocuments
If I had to guess, you’re doing too many things in too many places. Loading the families probably wont let you save the family document since the family is still open. I also don’t think you need to look at each family type since they would still share the same family document if they’re from the same family. Again, you’d be opening and modifying the same document more than once that way.
You should be able to do everything directly in the family document once you’ve opened it. It may require additional packages or the Revit API.
Thanks @Nick_Boyts for your response. What can be the solution? …
Which node can I use instead of “Family.Load” Or How can I close the loaded families and save after adding the parameter?
What would be the best way to filter the families with category and than with a parameter? After filtering I would like to add the shared parameters also
There are custom packages that deal with the FamilyDocument environment. I don’t know if they’ll have exactly what you need but it would be a good start. You can still do everything you’re doing in your current graph, you would just have to do it within the family environment. You would likely filter your list of original families into lists of those that do get parameters and those that don’t. You could then close and save or just close those families respectively.
@waqar.a.khan949 once you run the script, why don’t you close Revit then re-open it and check the families? The families are loaded in your Revit project and you are opening them at the same time, see if it helps.
Hi, Just checked. Doesn’t work. The parameters are not added. I am wondering which node can I use instead of “Family.Load” … Seems like that is causing the issues. I need to get families as elements or elements from the families to filter them with the parameter.
Right now I need to run the script 2 times to make it work.
You really shouldn’t cross post like this - not the way forums are typically used - posts in a thread should relate to posts in that thread. Your threads are visible in the topics board for everyone to see.
To help you out here in regards to before, I’m also playing with opening/editing/loading families currently. I seem to have managed to get the process to work but am still testing it. This script should open all doors in a project, add a parameter to them, then load them back to the project. Hope it helps give some ideas, it mostly uses Python but also has Clockwork/Crumple in it.
I know the forums generally don’t like background open processes when it comes to families, but it might be helpful. Can’t guarantee it’s 100% perfect, but seems to work for me.
This is just a prototype so I suggest learning more about Python/Revit API if you wish to take it further.