I’m trying to build a dynamo script to change the value of some casework families (set “depth” to 23" instead of the currently entered 24"). I’ve built the dynamo script in the attached screen shot based on some other threads I found via search here but it seems to be getting stuck processing it. The node “FamilyDocument.Name” gives the following:
“Warning: FamilyDocument.Name operation failed.
Please run this command in a family document.”
I’m running this file on a folder with only 3 family files in it, no projects/templates exist within the folder. The families have no default type so I added the node FamilyDocument.CreateFamilyType. Everything else was added to support the operation, what would be causing the error?
I’m guessing you’re running your graph from a project file though. FamilyDocument.Name does not have a document input so it runs in the current document.
I launched a project from our default template to open Dynamo. I tried just now relaunching all except using a family template to get Revit going and launch Dynamo. Now I get a different error at setparameterbyname:
“Warning: FamilyDocument.SetParameterByName operation failed.
Specified cast is not valid.”
Unfortunately it’s not that easy. You’re in a family document but you’re not in that family document. I’m not sure if there’s a way to do that for a list of families as it needs to be the active document all the way through. You would probably have to use Python to specify the document.
Thanks for clarifying about which family document it might be looking for. I got the impression from the other posts on Orchid package that this would be possible to run on a batch of families. Perhaps @erfajo will chime in with a way to do this in orchid…
Thanks for pointing me to that!
Now at the Document.Close node, I get a different warning:
“Warning: Document.Close operation failed.
The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.”
OK, I see what you are saying. Basically, in my image below, Document.BackgroundOpen creates list ‘0’, FamilyDocument.CreateFamilyType creates list ‘1’ and FamilyDocument.AllFamilyType creates list ‘2’. Then the script remembers all 3 lists until the very end, essentially running the command FamilyDocument.SetParameterByName 3 times on each family that is open, then lastly we are filtering it to only save/close list ‘0’.
I wasn’t thinking it would remember each of these 3 nodes as separate lists, rather that it would simply carry it forward. Still getting used to Dynamo, thanks for the guidance!
Thanks @awilliams - I figured it had to do with the lists, I now have some light reading to do. I was more curious why his node had that option and mine didn’t from the Orchid package…