Hey guys! You already helped me a ton, but I still could use some more.
My problem is:
I’ve got two lists of elements (well, family types I guess). And I want to select from one list, all types, that are NOT in the other list and then delete them. It would be perfect, if I could delete the types themselves instead of all elements, and then use purge, but it would do. If somone knows how to do this, please explain it very simply, I’m pretty new with Dynamo.
Ok, the node talbimman suggested (and Yna_Db properly named) worked.I had to add String.Contains and the primary list again, and then it worked. I’m still frustrated by the fact that my knowledge is so low, that I have no idea why something works or not! The working graph is the lower one.
Now maybe someone knoww what is happening in the upper graph. When I try to filter two lists using list.containsItem Which i hoped would filter out the missing types), or List.FirstIndexOf Dynamo, picks two random elements that are on both lists… Funny thing is, that when I deleted two different wall types, Dynamo then picked two other wall types (from different parts of the list), that also were present on both lists! List.FirstIndexOf used to work ok, but it seemed to have a problem once I added the delete node.
And another question. Is having assigning parameters two two lists of different Revit elements, creating new types of one family based on the types of the other, and also deleting the ones that don’t have corresponding ones in the first type two much for one Dynamo file? It’s all divided into two phases, but maybe it should be more divided? Does the order of elements from left to right influence the order of doing the commands, and is it very important? Maybe I should divide this into seperate files?
Ok, here is an example. Upper list is a list of General annotation types that use information from wall types, lower list is all used wall types beginning with “SC” in type mark. I’ve just deleted two wall types from the project Sc W9 and Sc D4. The lower graph found it correctly, the upper one seems to have just noted that there two less. On closer inspection I can see that the upper one gives a false value if “item” list gets do a deleted wall type, but assigns that not to the correct value, but the one that happens to be on the wall type list at the moment (note “false” value on 2 position in “List.ContainsItem” and FamilyType.Name" Nodes).
Anyway since I got a working graph this isn’t all that imporatant.
You’re filtering the wrong list. In the top portion you’re filtering the bottom list (incorrectly) and in the bottom portion you’re filtering the top list (correctly). That’s why the bottom works. If you look at the output from List.Contains, you have 58 booleans, but you’re masking the bottom list with only 55 items. The booleans align with the upper list (58 items) so you want to mask them.