Load Family and the .rfa and all it's nested component to a new location

Hi to all,

I create a script that let you load a Family with shared subcomponent in a project by a path input. Then the node have to save the .rfa file of the family (and all subcomponent) in a project directory folder and then reload it from this new path.

But for some reason sometimes the script works fine most of the times no.

The problem is in the node that have to get the nested element of the family.

Anybody could help me?

This script use a lot of Data-Shape and Orchid nodes and I suppose to use it with DynamoPlayer.
Now I’m able to upload the script, MammaAnatroccolo.dyn (31.4 KB)

Kind Regards

Vincenzo

Dear @erfajo you’re right (this is the result of several tries).
I’ll write on your bug report template on Github

May I ask why you want to open the Family, save it and then reload it?
Just out of curiosity to understand what you are trying to achieve with dynamo!

Sure! I want to do this because in my office a lot of people take families from other project without move the location of the .rfa file (every project have it’s own families folder) and if the edit the family the other project one will be overwritten.


I tested it quickly and once you are in the document of the host family you can select any element inside it with a filtered element collector. Here I randomly chose a nested family based on its category and its comment value, then i obtained the document. From there on I think you can do what you want.

I did not do it all in one python code to make it more intuitive here on the forum

First code:

doc = DocumentManager.Instance.CurrentDBDocument
actually here you should input your doc as IN[1]

cat=UnwrapElement(IN[0]).Id

OUT=FilteredElementCollector(doc).OfCategoryId(cat).ToElements()

Second code:

fam=UnwrapElement(IN[0])
famdoc=doc.EditFamily(fam)
OUT=famdoc
1 Like

please could you share the dynamo script to have a look more in deep about subcomponents of family?

Hello Ruben, that was a test file from three years ago and I do not have it anymore. What are you trying to do? What did you already try?

Let me guess that problem here is situation when user load host family to the project from corporate library than try to open child family from the project to modify and occasionally save it by default path connected with stable version of the family (instead of “saving as” with new path in project folder).

I share the concerns about such situations with colleuges but I hope this is not only Dynamo solvable problem and there are another solutions. May I ask for your opinion?