Get element types in background .rfa document

Hello, all.

I’m trying to open multiple .rfa documents (300+) to do some modifications, which include deleting parameters and associating parameters to generic forms (extrusions, sweeps, etc.). The parameters are deleted, but the material parameter for the generic forms are not associating with the document parameter. I think being used is not working because the script is obtaining all generic forms from the project that is open and active, not the family document that is open in the background. How to I select all solid generic forms of a .rfa in a background document?

Test.dyn (25.0 KB)

Does this work on a single family, in familyeditor, without the backgroundopen node?

If it’s working on a single family you can try other dynamo runners:

Hey,

Maybe this helps?

Cheers,

Mark

Hi, @Mark

I tried using the python script and Dynamo threw an error.

Hi,

If you want a list, you’d have to amend to something like…

docList = UnwrapElement(IN[0])
outList = []
for doc in docList:
    outList.append(FilteredElementCollector(doc).OfClass(GenericForm)
OUT = outList

There may be typos in this :slight_smile:

If you notice, I’m not using orchid nodes for this specific task, I’m using Rhythm, because it returns a Document object I can use… I think that given your graph, that will still work if you mix them, but I might be wrong.

Best of luck,

Mark

2 Likes

Yes you can mix them, Rhythm have some nodes for converting documents to Orchidt

Hi Mark. I have a similar situation to @ mcowleyC3ZDV. I have tried your python node with the modifications you suggested, but I keep getting errors I can’t really understand, here’s the code as modified per your direction:


this is the error I am getting:

Any help greatly appreciated

You need to convert the orchid doc to a revit doc.
There is a orchid node that calls to Revit object

3 Likes

Thank you, you are right, I used Object.ToRevitType and now it is all running, I appreciate your input very much

Now, once this problem is fixed, what I obtain is a list of Autodesk.Revit.DB.Element, in this case Autodesk.Revit.DB.Extrusion, but I can’t seem to access the extrusions themselves, I can’t find a way to unwrap those:


I need to access their parameters in order to filter, etc. Do you have any ideas or directions on this?

Thanks again

Hi,

You are accessing the Extrusions, but as a Revit element… Therefore you can use the Python to pull any of the information available from Revit… Extrusion Properties

If you wanted to access them as Dynamo elements, they would have to be ‘wrapped’, which is discussed here : Python 0.6.3 to 0.7.x Migration · DynamoDS/Dynamo Wiki · GitHub

Though, I’m not sure it is available for every type of element… One workaround is to output the element ID from Python, then use select by ID in Dynamo…

Hope that helps,

Mark

Hi Mark. I have been working on this during the weekend. I already consulted the site you suggested
and I was able to unwrap the elements as you indicated, with a simple additional python node:

code would be:

import clr

Import ToDSType(bool) extension method

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

wrappedElement = IN[0]
unwrappedElement = UnwrapElement( wrappedElement )

OUT = unwrappedElement

so that does give me the extrusions I am after, directly from background family documents, however, when it comes to associating shared parameters to those, it is proving difficult, I am trying to use the code in this thread, but it’s written for a different workflow (working in the current document as opposed to background ones)

anyway, I think I am violating the forum rules, I probably should follow up with a new topic, I appreciate your help!

Best regards