Save Families from Revit to a Path

You can try it, it’s easy way.

3 Likes

@robert12546358 Thank you! This did exactly what I needed it to do!
@erfajo The node works beautifully! Hope you kept it in the next update to Orchid. And thank you for the reference, I’ll slowly try to digest it all. Hopefully I get more familiar with it as time goes by.

Hi, Thanks for the solution but I am getting this error. How do I fix this ?

I am very glad i stumbled upon this thread and the python script is very helpful.
Everything is fine until i got an error exporting an in place family so i edited the script to have error exemptions.
Just a simple try and except is what i added to this.

"

import clr

clr.AddReference(‘ProtoGeometry’)

from Autodesk.DesignScript.Geometry import *

clr.AddReference(‘RevitAPI’)

import Autodesk

clr.AddReference(‘RevitServices’)

import RevitServices

from RevitServices.Persistence import DocumentManager

from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Close all transactions

trans = TransactionManager.Instance

trans.ForceCloseTransaction()

fams = IN[0]

paths = IN[1]

#unwrap the Dynamo elements

fams = map(UnwrapElement, fams)

for i in xrange(len(fams) ):
try:
famDoc = doc.EditFamily(fams[i])

	famDoc.SaveAs(paths[i])

	famDoc.Close(False)
except:
	pass

OUT = 0;
";

Thanks for the node in your package erfajo.

But I would also like to add a RunIt possiblity to this node so I can get it to run with a boolean.

In the python script I can built this in myself, but when I try to use this python script I get the same error as above (“family is not iterable”), while it’s a regular “generic model face based”

Do you maybe have a solution for this?

@Jason_Trahan, did you ever figure out how to accomplish this same task with Groups?

not yet…

Hello guys, im trying to use both the solution proposed by @robert12546358 and by @Dimitar_Venkov, but im having problems with both…

with the first one, i get this

but no file is created! any ideas?

and with dimitar`s, I get the following error

image

does anyone know any workaround? or is there a better way to do what i’m trying to do here?

EDIT: I also tried groups in the solution by dimitar, but it didn’t seen to work either

Hello Dynamo people,

I came across this topic because I need this script to store all the families from my Revit Model. Tried with Python node but comes the same error as for other ones from this topic. So I used the nodes that Dynamo have inside Revit 2024. In atachment you can find the script:

I have another question regarding this topic. Is it possible to set number of backUps for all these Families with Dynamo? Saving them I am getting number of 5 but I want just 1 to have…
Number of BackUps

Thank you for your answer.

Damir