Duct from polylines/Pts

There guys,
Is there a way to create ducts/ cable trays from polylines or set of points, within Rhino Inside Revit?
I don’t see any component for MEP.

Regards

Hi Jelis, MEP workflows definitely could use some native RiR components. These are on our radar but for now the only option is through scripting.

That’s great Japhy, and that could be apply to other MEP disciplines.
I see that those are not connected pieces.
Could you help me with the fittings in between?

Thank you in advance

That too is in the feature request queue. I can see what’s available in the api for connections here in a few weeks (about to leave town). Have you looked at the pyrevit mep extensions? Pyrevit is a great way to learn the Revit API.

Thanks Japhy again. I’ll try to figure it out. I can see an option that could work from the Revit API: doc.Create.NewElbowFitting

However It cannot work:

import rhinoscriptsyntax as rs
import RhinoInside
import clr

clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
clr.AddReference("RevitServices")
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application

pipes = UnwrapElement(MEPCrvs)
margin = Margin 

fittings = []
connectors = {}
connlist = []

for pipe in pipes:
    conns = pipe.ConnectorManager.Connectors
    for conn in conns:
        if conn.IsConnected:
            continue
        connectors[conn] = None
        connlist.append(conn)

for k in connectors.keys():
    mindist = 1000000
    closest = None
    for conn in connlist:
        if conn.Owner.Id.Equals(k.Owner.Id):
            continue
        dist = k.Origin.DistanceTo(conn.Origin)
        if dist < mindist:
            mindist = dist
            closest = conn
    if mindist > margin:
        continue
    connectors[k] = closest
    connlist.remove(closest)
    try:
        del connectors[closest]
    except:
        pass

for k,v in connectors.items():
    TransactionManager.Instance.EnsureInTransaction(doc)        
    try:
        fitting = doc.Create.NewElbowFitting(k,v)
        fittings.append(fitting.ToProtoType())
    except:
        pass
    TransactionManager.Instance.TransactionTaskDone()

OUT = fittings

Trying to translated from Dynamo Python environment without sucess.

Thanks again

Hi Japhy
Any improvements in MEP RiR?

Cheers

Hi jelis, there isn’t a timeline for new additions, these will come available as the developers work through their various priorities (integration into Rhino 8 being at the top right now)

A good place to keep an eye on is the release notes, where new features get added to the Daily build first, typically a month ahead of the Stable release. Rhino.Inside®.Revit