Split Pipes

I’m trying to split pipes using split geometry. But Split geometry won’t split a pipe or duct. What I am really trying to achieve is to split a pipe each side of another pipe. Drop the split piece. But the first task is to get dynamo to split the pipe

how would you like to split the pipe? Specified distance, parameter 0 to 1? More information would be great. This is possible using this logic http://thebuildingcoder.typepad.com/blog/2010/08/edit-wall-length.html, but we need some more information regarding what you want from the workflow.

Thank you for your reply

I would like to get the intersection between the pipes. Then split them a certain distance either side of the intersection.

But at the moment the split geometry node won’t split the pipe

thanks

Yes, unfortunately the split geometry node is just for geometry. It isn’t actually the Split command from Revit. DO you have a sample file you can provide for this?

Thanks again for your reply

This just a simplr file with a duct and a pipe clashing. See attached

Hi Dan,

I don’t think there is any Revit API method until now to split ducts and pipes. Alternate solution would be select the pipes you want split and then extract the curves then divide the curves by distance and create new pipes using python. Then finally delete the existing one.

1 Like

I dont see the split command specifically called out in the SDK doc but what you could do is use the LookupcommandID function. Looking at my journal file i noticed that the split command was “ID_Split” so i wrote this quick python script that uses that and looks up the ID then posts that. Now this is just the start you will have to figure out how to get the split point in the correct spot. I have used the postable command a lot in my DynaFabrication2017 package for calling other things in the ribbon such as Snoop.


Just remember that the split function requires you to use the mouse the tell it were to split so the code above will function the same. Now if you want to eliminate the mouse you will have to do something similar to Kulkul approach.

Thanks for your feedback

I’ve never used phyton. How can I draw pipes based on curves.

I would like to use the select model elements node but it doesn’t appear to work anymore

I researched @nathan.chapman’s method. It essentially activates the split command for you and you still have to click like through the UI. WHich is really awesome BTW! Is this what you wanted @Dan_Deery?

This is kind of a sore subject regarding the API in that there is no automated way to SplitAtParameter or SplitAtPoint. I have long wished for and have specifically requested this but it has not happened yet. As a structural guy I have not messed with pipes, but I have done splitting of columns and beams. The way you have to achieve this is to essentially determine the split point, make and then make shorter copies of the element that use the split point as start or end. The major pain point becomes that the instance parameters of the initial element (pre-split) are often lost in the process unless you explicitly re-author those piece by piece, parameter by parameter.

Beams actually got a split method in Revit API 2017, maybe pipes will follow.

Yeah…I haven’t gotten around to reading the 2017 API info yet mainly because I’m trying to keep most of my clients (and thus me) out of 2017 for text/tag reasons.
But that is good to know.

This is a method that can be useful for so many things that are not yet in the API, so I made a generalised version. It takes the “ID_xxx” name of any UI function as input and posts it.
I tried to put a switch in there to delay running until objects are selected in Revit (Eg with this) but I dont think it is working quite as it should.

import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
import Autodesk
from Autodesk.Revit.UI import RevitCommandId
from Autodesk.Revit.UI import UIApplication
from Autodesk.Revit.UI import ExternalCommandData
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication


#The inputs to this node will be stored as a list in the IN variable.
ID_Name = IN[0]  #Allows this to be used with any revit 'ID_xxx' input string
RunIt = IN[1] #Delay execution until selection set etc. has been made

if RunIt ==  True:
CmndID = RevitCommandId.LookupCommandId(ID_Name)
CmId = CmndID.Id
uiapp.PostCommand(CmndID)
errorReport = 'Success'
else:
errorReport = 'Set IN[1] to true to run'

#Assign your output to the OUT variable
OUT = errorReport

If you get the error “NoneType object has no Id” then the ID_xxx input does not exist.

1 Like

MEPover has nodes to place MEP elements by lines: