# \[Dynamo\] Cannot generate more than one ray bounce

**URL:** <https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [May 27, 2020, 1:35pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123 "2020-05-27T13:35:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TCKEAHY](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@TCKEAHY](https://forum.dynamobim.com/u/TCKEAHY)\
**Post date:** [May 27, 2020, 1:35pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/1 "2020-05-27T13:35:13Z")

</div>

Hello everyone.

I am now doing task which needs to measure the distance between ceiling top surface and the element above it. For now I have created a script as shown below:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/7/e7d0f9453562d8cfa9afec7ece39c91642206ef5.png)

However the difficulty I found is that only one ray bounce is generated every time I run the script:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/d/4d2ba1d5aa7bcee88fc52633660c668f2d35e463.png)  
As shown above, the ray bounce which is supposed to meet with the structural framing is not generated.

Could someone point out where I did wrong? Thank you.

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [May 27, 2020, 2:26pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/2 "2020-05-27T14:26:33Z")

</div>

Have you tried setting “raybounce” node lacing to longest?

---

<div class="post-metadata">

**Author:** ![TCKEAHY](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@TCKEAHY](https://forum.dynamobim.com/u/TCKEAHY)\
**Post date:** [May 27, 2020, 2:46pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/3 "2020-05-27T14:46:18Z")

</div>

Tried your suggestion, unfortunately the results remained the same.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/5161e8e85228f73996306bc91b34dcb294cb815c.png)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [May 27, 2020, 2:49pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/4 "2020-05-27T14:49:49Z")

</div>

Could you drop relevant files in google/Dropbox or similar and me link?

---

<div class="post-metadata">

**Author:** ![TCKEAHY](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@TCKEAHY](https://forum.dynamobim.com/u/TCKEAHY)\
**Post date:** [May 27, 2020, 2:53pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/5 "2020-05-27T14:53:55Z")

</div>

[Test 2.dyn](https://forum.dynamobim.com/uploads/short-url/qgOcTs94KnASwEFYYVymBlNABQO.dyn) (27.4 KB) [Project1.rvt](https://forum.dynamobim.com/uploads/short-url/wmGAflLFijnll685e2uyDJ212PP.rvt) (3.0 MB)  
There you go. The revit version is 2020

---

<div class="post-metadata">

**Author:** ![TCKEAHY](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@TCKEAHY](https://forum.dynamobim.com/u/TCKEAHY)\
**Post date:** [May 27, 2020, 4:12pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/6 "2020-05-27T16:12:41Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/9/993ae4fd937519c7e678082153bb328b3ca1b18c.png)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [May 27, 2020, 4:21pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/7 "2020-05-27T16:21:56Z")

</div>

Use Data-Shapes node instead:

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

---

<div class="post-metadata">

**Author:** ![TCKEAHY](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@TCKEAHY](https://forum.dynamobim.com/u/TCKEAHY)\
**Post date:** [May 27, 2020, 4:38pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/8 "2020-05-27T16:38:33Z")

</div>

Thank you. It works!

But forgive my desire, this script needs to input different Categories. Is there any way to avoid that (I still want to know what’s wrong with my node “RayBounce.ByOriginDirection”)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [May 27, 2020, 4:45pm UTC](https://forum.dynamobim.com/t/dynamo-cannot-generate-more-than-one-ray-bounce/51123/9 "2020-05-27T16:45:14Z")

</div>

> [@TCKEAHY](#):
>
> Thank you. It works!

Please mark the post as solved. You’re welcome!

> [@TCKEAHY](#):
>
> this script needs to input different Categories. Is there any way to avoid that

Yes possible you need to edit python inside custom node to work with all model categories but before editing make sure you save as custom node.

> [@TCKEAHY](#):
>
> I still want to know what’s wrong with my node “RayBounce.ByOriginDirection”)

That looks like a bug report the issue here:

> **[Issues · DynamoDS/DynamoRevit](https://github.com/DynamoDS/DynamoRevit/issues)**
>
> Dynamo Libraries for Revit. Contribute to DynamoDS/DynamoRevit development by creating an account on GitHub.
