# Pipe Creation from CAD \[Solved\]

**URL:** <https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044>\
**Category:** Developers\
**Tags:** python\
**Created:** [October 25, 2016, 7:07am UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044 "2016-10-25T07:07:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sacredcrow](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sacredcrow](https://forum.dynamobim.com/u/sacredcrow)\
**Post date:** [October 25, 2016, 7:07am UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/1 "2016-10-25T07:07:10Z")

</div>

Hi All,

Thanks Manel\_Fernandez for the post on creating Pipe from CAD.

> [@Creating pipe from CAD file](https://forum.dynamobim.com/t/creating-pipe-from-cad-file/4256):
>
> Hi there, I’ve modified this python script in order to create ducts from a cad file and now it works. Now I would like to do the same but with pipes. The thing is that I should change at least the line 40 and 31: Ducttype = IN[3] doc.Create.NewDuct(x, y, Ducttype) Could somebody tell me the correct command and parameters for pipes? thks

I followed the steps while everything was great until I bump onto the Python error.

I need help on line 38.

Please refer to the screenshots below.

Thanks

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d51bd75a49ca34c6ed4f986ab38492dec44cbd0e.png)

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/26520f43fd9f795593f7b35644716f3256c7581c.png)

---

<div class="post-metadata">

**Author:** ![sacredcrow](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sacredcrow](https://forum.dynamobim.com/u/sacredcrow)\
**Post date:** [October 25, 2016, 7:10am UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/2 "2016-10-25T07:10:31Z")

</div>

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/1f34550eb2bf01a65e95b6b6220663ad9b90b620.png)

there is the screenshot of the whole script.

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [October 25, 2016, 8:43am UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/3 "2016-10-25T08:43:50Z")

</div>

You’re missing the Level Id on that line

---

<div class="post-metadata">

**Author:** ![sacredcrow](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sacredcrow](https://forum.dynamobim.com/u/sacredcrow)\
**Post date:** [October 25, 2016, 9:01am UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/4 "2016-10-25T09:01:52Z")

</div>

Thanks Viktor!!!

it works!!!

BTW why is level is considered as a connector.

Sorry, just started with Dynamo.

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [October 25, 2016, 9:08am UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/5 "2016-10-25T09:08:54Z")

</div>

It is not considered a connector. There are two other methods Create(Document, ElementId, ElementId, Connector, Connector) and Create(Document, ElementId, ElementId, Connector, XYZ) which use 5 parameters. Since you were feeding only five the API interpreted it like that.

see more info here:  
[http://www.revitapidocs.com/2016/5882a277-cba2-cefa-f5fb-2f43f247b4dc.htm](http://www.revitapidocs.com/2016/5882a277-cba2-cefa-f5fb-2f43f247b4dc.htm)

---

<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 11, 2017, 5:16pm UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/6 "2017-01-11T17:16:08Z")

</div>

What is the correct line of code?

Thanks.

John

---

<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 11, 2017, 5:16pm UTC](https://forum.dynamobim.com/t/pipe-creation-from-cad-solved/7044/7 "2017-01-11T17:16:36Z")

</div>

What is the correct line of code?

Thanks.

John
