Get all elements by parameter values

Hi guys,

I have been struggling with this.

I have a list with IfcGUID values and another list with string values belonging to each of IfcGUID values.

Now I want to find all the related elements in my Revit model, that corresponds to these IfcGUID values and then set their parameter (which I created as CCS_ProductId) to the value in the list with string values. I hope this makes sense. So basically the question is: Is it possible to find all elements in my Revit model that corresponds to a parameter value (in my case IfcGUID)?

1 Like

Hi, could you also tell where do the IFC GUID values come from?

They come from when I exported my Revit file to IFC via the Export option in Revit.

I then do some analysis in another system (semantic web software) and then I generate the list as presented.

Now the task for me is to find the elements corresponding to these IFC GUID values (which is a parameter in my IFC model) and then set the parameter value of a instance parameter I have created called CCS_ProductId to list number 2 values. So each IFC GUID value has a CCS_ProductId value i.e. their is a 1-1 relationsship between the two lists.

In this case, this could help you to create the related list of elements with an IfcGUID parameter into Revit:

You would then probably need to select all elements:
https://forum.dynamobim.com/t/get-all-elements-in-model-categories/9447
…and match the lists afterwards, for instance by lists comparison or by using a dictionary.

Thanks for the help.

However this does not solve my problem. I just want to get the elements in my model, which has the value in my IFC_GUID list corresponding to the parameter called IfcGUID.

Isnt there a package that says: give me the parameter name and the value of this parameter and then I’ll search all your elements and give you the corresponding Revit element? :slight_smile:

This thread could help you to get started:
http://dynamobim.org/forums/topic/selecting-model-elements-based-on-parameter-value/

Ok maybe you could help me with this :slight_smile:

I have found all elements that have an IfcGUID parameter value in my model. I make a list of these values and then I try to match my original list to this list:

But I dont get any results… only false …

Ok I managed to get some results :slight_smile:

I used the SetIntersection node:

However now my finale problem is to order my list of elements so that they correspond to the same order as my original list of IfcGUID. Any suggestions?

There are different ways to do this, but this one could work:
http://dynamobim.org/forums/topic/reorder-my-list/

I appreciate your help Yna_Db!

But I dont get it. Could you help me?

I can’t help further without replicating the process. I am too busy for this right now but I will take a look later today…

Thank you

Could a Springs.Dictionary.ByKeysValues node (from Springs Nodes) help?


The idea is to associate the IfcGUIDs from Revit (as keys) with their respective elements from Revit (as values) so that you can query the elements corresponding to the IFC GUIDs from your list (as searchKeys).

If I switched the bottom list to be list 1 and the top list to be list 2 in SetIntersection it works!

However I don’t know why the node Element.ParameterExists all of the sudden only gives me null?
Some of the elements do have values for the parameter IfcGUID??? :confused:

It happens that restarting the graph or even Dynamo solves this kind of problem…

I tried shutting both Revit and Dynamo down. And restarting. But nothing happened. It still gives me null values for all even though most of my elements have a value for the parameter IfcGUID… :confused: Anything else I could do?

The best would be to proceed some tests to identify where the issue comes from, for instance:

  • Is there any result using other nodes such as Element.GetParameterValueByName, Parameter.ParameterByName + Parameter.HasValue, etc.?

  • Does it work when entering a list of element which all have an IfcGUID parameter (and instead when none of them have any)?

  • Does it work when using another selecting method? Is there a specific type that is causing the trouble?

etc.

It will be useful for everyone to report your conclusions here afterwards…

Using the Element.GetParameterValueByName I get results as expected.

Also with the Parameter.ParameterByName I get results although there are null values, but that is also what I would like, since I need to create my mask from Element.ParamterExists.

I will say that my Dynamo was complaining about obselete versions and I then uninstalled all clockwork packages I had installed (I had many older versions) and then I installed the newest one. And since then it hasn’t worked. :confused:

I would say that, even if Parameter.HasValue gives a warning, the boolean list that comes out of it should be correct and usable (to be checked).
About Element.ParameterExists, Clockwork for Dynamo 1.0.2 is installed and works from my side. It is possible that not all elements are accepted nor all list structures. Some more tests could possibly help to find where the problem lies…

I had more Clockworks installed and the node I used was from an older version i think. It is working now. So thanks for the help Yna_Db. I will marked this thread as solved.