bjkris
August 22, 2018, 9:24am
1
Hi there all
I am trying to add roomnumbers to all of my ventilation components, but I am stuck at pipes and ducts, beacuse the graph I use for, for instance Airterminals searches for elements in room… I am assuming, for this to succeed, I need to divide my pipes into curvesegments, so that I can search for these curve points in rooms.
So here is my Attempt for now, where I have reused my graph for locating airterminals in rooms:
But I don’t know what I am doing wrong, because when I try to divide my pipes into curves, it does not return any values…?
But what I am trying to do afterwards is locate the rooms, at these points from the curves, whereafter, I am going to sort the results, so that I only get one instance of each room, I then want to write back to the pipe.
Can anyone help me…?
Hi,
Have you already seen this ?
Hi @Pal_Roe_Larsen
I don’t think its possible to get centerline from “Ducts - Centerline”. However you can get the ducts Centerlines from ducts like this:
[image]
Hi,
There are probably several ways to collect pipes in linked rooms, but but I did it with the BoundingBoxIntersectsFilter method.
I modified the node “Tool.GetSurroundingElements”
from SteamNodes package to work with linked document.
#python nodes in dynamo 1.0
#proposed by Julien Benoit @jbenoit44
#http://aecuandme.wordpress.com/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import itertools
import operator
doc = IN[3]
activeV=UnwrapElement(IN[4])
host = []
finst=[]
finstID=[]
for i in IN[0]:
host.append(UnwrapElement(i))
for i in IN[1]:
finst.append(UnwrapElement(i))
for i in IN[1]:
finstID.append(UnwrapElement(i).Id)
superset=[]
hloop=[]
for h in host:
collection = List[ElementId](finstID)
collector=FilteredElementCollector(doc,collection)
a=h.BoundingBox[activeV]
c=Outline (a.Min,a.Max)
d=BoundingBoxIntersectsFilter(c,float(IN[2]))
e=collector.WherePasses(d).ToElements()
setlist=[]
hostlist=[]
hostlist.append(h)
setlist.append(e)
all_lists = [hostlist,setlist]
c=reduce(operator.add, all_lists)
superset.append(c)
OUT=superset
!! There are several lacings and levels to set on the nodes.
bjkris
August 29, 2018, 9:25am
4
Holy cr…! I think I need to learn some code…
Thank you so much Alban!