Complex list compare with multiple structure

Hello ,

A brain burning question for you. Tips are very welcomed.

How to compare list with multiple structure?
I don’t understand the second condition “WALL_02”, it seems like this part didn’t work at all.

ListTest.dyn (28.1 KB)

Hi @Congzheng ,

Please search around on the forum, this question has been asked a lot already :slight_smile:

Thanks, I’ll search again in the forum.

Doesn’t it work if you just change the y input to @@L2? Or could you include the exact desired output?

Is this what you are aiming for?

1 Like

@Congzheng In case if you are looking for a Python solution:

OUT = []
for toChecks,checkFors in zip(IN[0],IN[1]):
	temp = []
	for toCheck in toChecks:
		if toCheck in checkFors:
			temp.append(True)
		else:
			temp.append(False)
	OUT.append(temp)
2 Likes

no, if I do that, the result lost the data structure.

Exactly !
I couldn’t do it in Python because of the mutiple data structure.
Besides, I am always trying to learn Python but I couldn’t find a good way. The logic is too difficult for me to understand. Do you have some advices ?

Yes, it can be one of the solution but needs to use boolean AND / OR to get the result.

In terms of advice, I would say; avoid creating complex list-structures and focus on getting easy-to-manage single lists of data. If you ever have to append your definition, it will make things much easier for you, or for your colleagues. I would focus on getting doors into one list, walls into another, windows into a third…and then dealing with those lists individually…especially when you want to start sorting them. The community here is (almost) always happy to help.

In which list? I typically use the “IF” node as AND/OR Gates.

If true, then true = 1 and false = 0

then I add those together in order to filter on AND / OR Conditions.

For “OR” conditions, only one condition must be met, and therefore the sum only needs to be greater than 0.

For “AND” conditions, I can set two, three, four, five different conditions and the result must fulfill all of them; thus the sum will be either two, three, four or five respectively.

Here is an example:

1 Like

Hi Matthew,

Thank you very much for your kind advice. It’s a smart and clear strategy.

I would be happy to discuss the complicity of this subject.

The story begins with analysing the .ifc files, to ensure if the BIM models have the specified data.
Here is the level of the data :

  1. a list of different .ifc files (architecture, structure, MEP, …)
  2. tens of categories
  3. tens of parameters
  4. different types of data (they should be filled in according to the fixed formats)

In order to analyse the data from ifc files, my current soultion, is to export ifc to excel. (It could be great if data can be obtained from ifc without open it)
Since I can’t make operation with 4 levels of complicity, I will avoid analyse all the ifc files in one shot, so I analyse one ifc each time.
Still, I will make a pulldown list for categories, so each time I analyse one category.
Now the data will be more clean, I only need to deal with different data types and compare with their objective formats.
Since each time I will receive different ifc file, the parameters of this category and its objective formats will be very dynamic. So I divide all the objective formats into several groups, each group has only one similar format type, i.e. they all start with a fixed code( but still varies from projects).
That’s why I arrive here - analyse a bunch of two-level data. one ifc / excel > one category > one type of objective format.

But as you said, avoid creating complex list-structures. I always asking myself if it’s because the mission is complicated or I made it complicated. Despite I tried to make workflow clear.

@Congzheng Start with a basic Python course on Youtube and learn the basics.
Then you can dive into these resources:

Keep an eye out for what people are doing on this forum. It’s a great place to learn as well!

2 Likes

When I need to script something complex (like what you are trying to accomplish) I typically break that down into smaller individual scripts. These scripts are then numbered to run them in a predefined order.

Trying to create one script to do 20 things is much more difficult to create, troubleshoot and adjust than breaking that down into multiple smaller pieces.

image

It sounds like you are attempting to do some data-validation with Excel.

I’m not sure what the final output needs to look like, but I might offer a few other solutions: DataValidation of the IFC-Files with Solibri (expensive) or DataValidation of the IFC-Files with Revizto 5. (You can create view filters, and exchange BCF-Files.)

If you are still wanting to use dynamo:
I would recommend starting with one model type (for example architecture) and one category (for example, doors) and creating a template from that. Don’t try processing complex lists with multiple lines of data; build one “line” of data-processing and then copy-and-swap the differences out.

The major drawback to this is obviously, making corrections or adjustments to the scripts. It’s a real issue, so try and get one script working as elegantly as possible. Here is an example of a relatively complex script for processing technical openings:

I would recommend grouping elements in dynamo, color coding, and keeping things neat in order to make understanding and adjusting the script easier to understand. If I open a complex graph which is disorganized, it will take me 30 minutes just to figure out what it is doing, and what the intent is. I use groups like they are blocks of codes with comments: Read Excel File, Create Origin Point, Set Parameter, Change Workset, etc.

I also recommend using the CTRL+L button as you move along to keep things tidy if you aren’t already in the habit of doing so.

Happy to help and contribute more…but I need to run!

Please, keep us updated! :slight_smile: