Create Duct From CAD

#1

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?

@Kulkul

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

0 Likes

#2

There is literally NO information in your post…

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

2 Likes

#3

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!

0 Likes

#4

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

1 Like

#5

My English is weak

0 Likes

#6

so I add for he wrote

0 Likes

#7

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

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()
0 Likes

#8

“Current Document” is from the Archilab package…

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. :slight_smile:

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

1 Like

#9

where we will enter the duct sizes

0 Likes