Yet another post on Loading Families using Dynamo. I’ve read through most and they have been helpful but I am stuck on an issue. And I am aware of @erfajo and his dyn addition but I have to stick to the native python route for a couple of reasons including the desire to understand why my code at its current state isn’t functioning as intended.
For a list of Families (“To Load In”):
I want to load them into a list of families of matching Parent [index]:
So C:\familyPath1 should load into C:\hostPath1 & 2, C:\familyPath2 into C:\hostPath3,4,5 and so on…
My code so far:
paths = IN = the hostPaths
lpath = IN = the familyPaths
savpath = IN = the hostPaths with a suffix
So for every [ x ] in familyPaths (to Load in)
open current familyPath
for every [ y ] in hostPath [ x ]
open each child of hostPath [ x ]
load and save
When I just run the for loops without any familydocument calls, my watch list returns the items correctly, showing that it is iterating correctly going from List ……to  and so on. I have (2) main issues:
- Currently, when all is turned on, it iterates just through the  first index of familyPaths (lpath):
loading in C:\familyPath1 into
My guess is that maybe the lDoc needs to be Closed at some point.
- Even with SaveAs options, it only seems to work when I save the families by a different name and cannot save over the same file.
Any help would be greatly appreciated!