Family.ByName not recognizing fabrication family

Hello all!
I am quite new to Dynamo, so any advice is appreciated. I want to select all instances of a fabrication part, however when I select the part and pull the family name, then feed that name to the Family.ByName node (which pulls the correct family name), it cannot find any matching families in the current document. I only have one document and view open. Additionally, when I pull the family using the Element.GetParameterValueByName, it returns a completely different family name. Does anyone know why this is and how I can select the correct family?

Thank you in advance

Hi,
When you select an element, you want to find out how many of that element there are, if I understand you correctly.
Can you try this

Volcan,
Thank you for the reply. I do not want to just find out how many there are, but to select all of the same family. What I find strange about my node configuration is that it pulls the family name from the current document, and when I go search that same document it says that a family of that name does not exist. I would love to try your code, but unfortunately my distribution does not appear to have the Elements.Type node. Does that come in an addon package?
image

With this, you can take not only how many, but also those elements and process them.
Archi-lab.net package

Volcan,
For some reason, Archi-lab will not appear under the Addons list after installing, despite installing with no errors. Does it support the latest version of Dynamo? I am currently using the latest build for Revit 2022, which I believe is version 2.12

You need to install the version of Archi-lab for your Revit version. This is the version ending in “22” for Revit 2022, “21” for Revit 2021, and so on. See the link above for more info.

1 Like

@Carter123
You can also use this method if you are having trouble installing the Archi-lab package.

Thank you all for the help. However, unlike your example volcan, my element.type appears to be pulling the element type, not the family type.

with the error "Warning: ElementQueries.OfFamilyType expects argument type(s) (Revit.Elements.FamilyType), but was called with (Revit.Elements.ElementType). "

See what parameters you have for the element (not the element type) via an element.parameters node.

Fabrication parts are very unique as they aren’t really Revit elements the way most are, so you may have to use another method of collection entirely. If you post a sample model I might be able to dig into this and see what comes up.

Right, I was wondering if fabrication parts had anything to do with it. I have been trying to come up with a workaround, and think I may nearly have it. I am trying to tag all selected elements (those elements being the fabrication families I have been trying to select), but once I try to run the tag node one of two things happen, depending on which node is used. First, if I use the “Create Annotation Tag” node from archi-lab, I get the following error:


If I use the OOTB tag.byelement, Revit will become unresponsive and I am forced to kill the process using command prompt. I have attached the file below if that helps. I apologize if this is straying too far from the original question; If I should make a new thread please let me know.

Thank you again
Auto-Tag 2.dyn (47.2 KB)

We can keep it in this thread for now - but we need to include how you’d elected the instances as well in the post marked as a solution.

Can you post an RVT with a half dozen or so fabrication parts? Really simple model, nothing crazy. I don’t want to just make one and assume the wrong version of Revit or the wrong creation method.

Thanks for sharing the Revit file via DM.

The out of the box Tag.ByElement Node works fine for me:

I am not sure about the logic behind the bounding box filters, as you net a few duplicate connections in the process.

Jacob,
How long does that operation take for you? When I attempt to use this node, Revit/Dynamo will stop responding and eventually I am forced to kill the process.

Edit: The strangest thing is the log file does not show anything relating to a crash from what I can see. The last few lines after “connected to node x” etc. are simply autosaves

In the sample file you sent? <30 seconds.

Might have a conflicting add-in, or a worksharing issue on a real data set.

Can you open a new Revir session, reproduce the issue, quit Revit or let it crash, and post the Revit journal?

1 Like

Jacob,
Updating this thread with the information you send over DM:
I took your advice and disabled all addons, as well as switched the run style from automatic to manual. It worked! Thank you very much. It appears that the main issue was not the addons but the automatic run setting, as when I switched back to auto it crashed once again, despite all addons being unloaded. Marked as solved!

1 Like