# Create Duct From CAD

**URL:** <https://forum.dynamobim.com/t/create-duct-from-cad/23190>\
**Category:** Revit\
**Created:** [June 28, 2018, 12:38pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190 "2018-06-28T12:38:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhay61](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@muhay61](https://forum.dynamobim.com/u/muhay61)\
**Post date:** [June 28, 2018, 12:38pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/1 "2018-06-28T12:38:49Z")

</div>

HELP ME

Hi Kulkul,  
I get the following error. I am newbie sorry for silly question but if there is any package I need to download please let me know

Current Document Custom Note: Error: Custom node definition is not loaded!

Another question can I use conduits instead of ducts?

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/0/b048f12fe4d89e9641a87629f8a608eb700b8cbb.png)

> [@Create Pipe or duct from dwg](https://forum.dynamobim.com/t/create-pipe-or-duct-from-dwg/6816):
>
> I would like to create pipe or duct from DWG link (line or polyline). Do you have an idea ?

@Kulkul

I’m new on the forum I will not get used to rules

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [June 28, 2018, 12:43pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/2 "2018-06-28T12:43:38Z")

</div>

There is literally NO information in your post…

Why kulkul? What is the python script? have you searched for the missing node?

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [June 28, 2018, 12:50pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/3 "2018-06-28T12:50:55Z")

</div>

Where have you gotten the graph from might be a good place to start… That is where you should search for information on where the node is from, if you are just starting dynamo i would not go into using python just yet, and focus on actually reading and understanding the dynamo primer!

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [June 28, 2018, 12:52pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/4 "2018-06-28T12:52:24Z")

</div>

> [@muhay61](#):
>
> @Kulkul
> 
> I’m new on the forum I will not get used to rules

Why are you tagging kulkul? Why will you not get used to the rules?

---

<div class="post-metadata">

**Author:** ![muhay61](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@muhay61](https://forum.dynamobim.com/u/muhay61)\
**Post date:** [June 28, 2018, 12:55pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/5 "2018-06-28T12:55:06Z")

</div>

My English is weak

> [@Create Pipe or duct from dwg](https://forum.dynamobim.com/t/create-pipe-or-duct-from-dwg/6816):
>
> I would like to create pipe or duct from DWG link (line or polyline). Do you have an idea ?

---

<div class="post-metadata">

**Author:** ![muhay61](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@muhay61](https://forum.dynamobim.com/u/muhay61)\
**Post date:** [June 28, 2018, 1:01pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/6 "2018-06-28T13:01:07Z")

</div>

so I add for he wrote

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [June 28, 2018, 1:28pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/7 "2018-06-28T13:28:54Z")

</div>

That is the kind of link, information etc that needs to be present when you create a topic, you should read this:  
[https://forum.dynamobim.com/t/how-to-get-help-on-the-dynamo-forums/4677](https://forum.dynamobim.com/t/how-to-get-help-on-the-dynamo-forums/4677)

I will just add the python script in case anyone want it:

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

# Import DocumentManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
from Autodesk.Revit.DB import *
from Autodesk.Revit.Creation import *
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

# The imputs to this node will be stored as a list in the IN variable.
# doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
doc = IN[0]
duct = Autodesk.Revit.Creation.Document

#create workset collector
Ducttype = IN[3]
#extract workset's name and ids
k = IN[1]
l = IN[2]

for i,j in zip(k,l):
	x= i.ToXyz()
	y= j.ToXyz()
	TransactionManager.Instance.EnsureInTransaction(doc)
	doc.Create.NewDuct(x, y, Ducttype);
OUT = id
TransactionManager.Instance.TransactionTaskDone()
```

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [June 28, 2018, 1:31pm UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/8 "2018-06-28T13:31:42Z")

</div>

> [@muhay61](#):
>
> I get the following error. I am newbie sorry for silly question but if there is any package I need to download please let me know
> 
> Current Document Custom Note: Error: Custom node definition is not loaded!

“Current Document” is from the Archilab package…

> [@muhay61](#):
>
> can I use conduits instead of ducts?

As for this part, no you cannot create conduits using this script as on line 40 in the python script the method “NewDuct” from the API is used. You can if you desire have a look in the Revit API for the method of creating conduits. 🙂

Lastly as far as I can see you still need to define the “ducttype” as the input of “IN[3]” in the python node.

---

<div class="post-metadata">

**Author:** ![SHIBUJOSE](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@SHIBUJOSE](https://forum.dynamobim.com/u/SHIBUJOSE)\
**Post date:** [November 16, 2018, 9:30am UTC](https://forum.dynamobim.com/t/create-duct-from-cad/23190/9 "2018-11-16T09:30:06Z")

</div>

where we will enter the duct sizes
