# Cross-products and sub-lists

**URL:** <https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227>\
**Category:** Lists-Logic\
**Created:** [July 27, 2018, 2:39pm UTC](https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227 "2018-07-27T14:39:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [July 27, 2018, 2:39pm UTC](https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227/1 "2018-07-27T14:39:06Z")

</div>

Hello everyone 🙂

I am trying to apply a node with cross-product lacing with a list with 3 levels (@L3). However, i am a bit confused… I am just basically trying to find the intersection of a set of surfaces with itself (@L2), but i have other lists too (@L2 too).

In other words :

What i have :

- List : (@L3)
  - 0 List (@L2): 7 Surfaces
  - 1 List (@L2): 4 Surfaces

What i want :

- List : (@L4)
  - 0 List (@L3) : 7x7 surfaces intersections
  - 1 List (@L3) : 4x4 surfaces intersections

Does anyone know how to do that without using a Python Script node ?

Best regards

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [July 27, 2018, 3:08pm UTC](https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227/2 "2018-07-27T15:08:46Z")

</div>

By the way, if anybody wonders about how to do it in Python :

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

surfs = IN[0]

resultat = []
for i in range(len(surfs)):
	set_surfs = surfs[i];
	mini_res = []
	for j in range(len(set_surfs)):
		micro_res = [];
		for k in range(len(set_surfs)):
			micro_res.append(Geometry.Intersect(set_surfs[j],set_surfs[k]));
		mini_res.append(micro_res);
	resultat.append(mini_res);
OUT = resultat
```

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 27, 2018, 3:34pm UTC](https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227/3 "2018-07-27T15:34:26Z")

</div>

@mellouze Something like this?

 ![intersect](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/f/ef68b9425ce0667e21bc07f39dd3a9a7fdc31835.png)

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [July 27, 2018, 3:40pm UTC](https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227/4 "2018-07-27T15:40:57Z")

</div>

Exactly ! Thank you very much kind sir 🙂

If i may ask you, how does this translate in terms of **Geometry.Intersect** and **List.Flatten** node ? (If one feels more more confortable with nodes that Code Block)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 27, 2018, 4:03pm UTC](https://forum.dynamobim.com/t/cross-products-and-sub-lists/24227/5 "2018-07-27T16:03:10Z")

</div>

> [@mellouze](#):
>
> how does this translate in terms of **Geometry.Intersect** and **List.Flatten** node ?

Tried to achieve it with nodes, but couldn’t ☹  
(Might partly have to do with the fact that _Keep List Structure_ doesn’t seem to be working in 2.0)
