# Python script error? Reading from CAD

**URL:** <https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964>\
**Category:** Developers\
**Created:** [January 18, 2017, 10:29pm UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964 "2017-01-18T22:29:22Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![T\_Pover](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/t_pover/32/19147_2.png) [@T\_Pover](https://forum.dynamobim.com/u/T_Pover)\
**Post date:** [January 19, 2017, 7:07am UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964/21 "2017-01-19T07:07:46Z")

</div>

Seeing as you are having a hard time figuring out the python script, you can also try the Pipe.ByLine node from the MEPover package:

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

---

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 19, 2017, 8:07am UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964/22 "2017-01-19T08:07:42Z")

</div>

The [element.Id](http://element.Id)?

---

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 19, 2017, 8:13am UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964/23 "2017-01-19T08:13:21Z")

</div>

Thanks know there are quite few packages out there. Will try it as last resort

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [January 19, 2017, 8:17am UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964/24 "2017-01-19T08:17:02Z")

</div>

The node worked ok when I tested with some arbitrary points. One thing that is an issue is that you are using all the 2D geometry when you really want to be using a centreline. Also you need to filter out where the lines are too small as this will cause errors and won’t be able to create the pipe.

I would also “zip” the lists for the points in the For loop.

```
For pt1, pt2 in zip(FirstPoints, SecondPoints):
       #do some work

```

But you’re getting there. 🙂

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [January 19, 2017, 8:20am UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964/25 "2017-01-19T08:20:47Z")

</div>

> [@i.tzivanidis](#):
>
> element

No, the variable SecondPoint is written secondPoint.

---

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 19, 2017, 8:21am UTC](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964/26 "2017-01-19T08:21:12Z")

</div>

Thanks mate really appreciate it

[Previous page](https://forum.dynamobim.com/t/python-script-error-reading-from-cad/8964.md?page=1)
