# Sum only Corresponding Member

**URL:** <https://forum.dynamobim.com/t/sum-only-corresponding-member/106924>\
**Category:** Revit\
**Created:** [January 1, 2025, 5:33pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924 "2025-01-01T17:33:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![f.saeedian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/f.saeedian/32/191606_2.png) [@f.saeedian](https://forum.dynamobim.com/u/f.saeedian)\
**Post date:** [January 1, 2025, 5:33pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/1 "2025-01-01T17:33:16Z")

</div>

Hello friend again. I confused by Sum two sample list. I want to only corresponding member be added to each other. You can see the pic. But i cant do that. Do you have solution for that?

 ![IMG_20250101_204901_269](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/3/63070e066c6c90dc4cd85751cbcaee75ab79c480.jpeg)  
 ![IMG_20250101_204856_488](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/ac3e2ceec9ae71266d1017ff63d004d827aaa52a.jpeg)

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [January 1, 2025, 5:57pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/2 "2025-01-01T17:57:43Z")

</div>

@f.saeedian

you will need some kind of zip function

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/f/afe66f803e57a114a020874ab6e22dda0e207ff3.png)

```py
lis1 = IN[0]
lis2 = IN[1]

lis3 = []
for sublist1, sublist2 in zip(lis1, lis2):
    for i, val2 in enumerate(sublist2):
        lis3.append([val2 + val1 for val1 in sublist1])

OUT= lis3

```

---

<div class="post-metadata">

**Author:** ![f.saeedian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/f.saeedian/32/191606_2.png) [@f.saeedian](https://forum.dynamobim.com/u/f.saeedian)\
**Post date:** [January 1, 2025, 7:06pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/3 "2025-01-01T19:06:19Z")

</div>

thats great and work , but I want to use that for determine point distance, can you help me how I can do that by python script?

 ![111111111111111111111111111](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/2/9243301e4ca79a620ff22c3271212fcfc6cf6f13.png)

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [January 1, 2025, 7:25pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/4 "2025-01-01T19:25:18Z")

</div>

Hi,  
You add

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

```

Geometry.DistanceTo(val1,val2)

Cordially  
Christian.stan

---

<div class="post-metadata">

**Author:** ![f.saeedian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/f.saeedian/32/191606_2.png) [@f.saeedian](https://forum.dynamobim.com/u/f.saeedian)\
**Post date:** [January 1, 2025, 7:31pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/5 "2025-01-01T19:31:48Z")

</div>

thanx alot Mr. @christian.stan that is true ,

 ![5446](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/f/1f3f98069a34d6269fbabf7bcf73f9e44b555e9e.png)

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [January 1, 2025, 7:49pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/6 "2025-01-01T19:49:46Z")

</div>

thank you for the compliment, all the credit goes to Mr. Andreas, a natural hard worker (also a beer on the terrace from time to time, the good Dynamo spirit) the training provided by Mr. Erick Frits seems to have made him progress a lot Also no subliminal message  
Sincerely  
christian.stan

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [January 1, 2025, 7:56pm UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/7 "2025-01-01T19:56:24Z")

</div>

@christian.stan

thats true [Erik Fritz](https://learnrevitapi.com) is my mentor. 😄 it boosted my understanding how code works in the field.

🙌

---

<div class="post-metadata">

**Author:** ![rajeshjamariya16](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@rajeshjamariya16](https://forum.dynamobim.com/u/rajeshjamariya16)\
**Post date:** [January 2, 2025, 4:56am UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/8 "2025-01-02T04:56:07Z")

</div>

I see this was already solved here. nevertheless it was a nice little problem for me to work on. while I’m here I wonder if anyone has some sort of workbook to practice python on dynamo and revit problems like this. I have started my python journey and it would be great to work on some practice problems. Any guides. 😇

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [January 2, 2025, 7:27am UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/9 "2025-01-02T07:27:59Z")

</div>

@rajeshjamariya16

[Learning advice - Dynamo](https://forum.dynamobim.com/t/learning-advice/22658)

and this community [here](https://learnrevitapi.com/)

---

<div class="post-metadata">

**Author:** ![rajeshjamariya16](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@rajeshjamariya16](https://forum.dynamobim.com/u/rajeshjamariya16)\
**Post date:** [January 2, 2025, 10:29am UTC](https://forum.dynamobim.com/t/sum-only-corresponding-member/106924/10 "2025-01-02T10:29:31Z")

</div>

Great resources! Thank you!
