# Revit split line function in Dynamo

**URL:** <https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [September 26, 2018, 1:20pm UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461 "2018-09-26T13:20:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 26, 2018, 1:20pm UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/1 "2018-09-26T13:20:53Z")

</div>

Hi guys,

I am trying to split pipes that the joint appears. The only problem is u need the "splitLine"function from revit. Has anyone come across this node ?

Hope u guys can help me,  
Verdi

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 27, 2018, 8:48am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/2 "2018-09-27T08:48:16Z")

</div>

I don’t believe this exists - if it does it’s a custom node in a package I don’t have much experience with. Instead, try this:

1. Find the line in Dynamo
2. Find the intersecting point.
3. Split the line at that point - you should now have two lines in Dynamo.
4. Set the location of the pipe to the first line in the list.
5. Create a new pipe along the second line.

Several example threads exist on this, but I prefer this one: [Split Geometry At a given length - #4](https://forum.dynamobim.com/t/split-geometry-at-a-given-length/12691/4)

---

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 27, 2018, 9:20am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/3 "2018-09-27T09:20:39Z")

</div>

Goed idee, but I have already tried this and it does not seem to work.

I am using piping in Revit. When u use the command split line in Revit , the joint where u split line automatically appears. When u place a pipe on a line…via dynamo and then another pipe (same type) on a connected line, it automatically connects the pipes and they become one.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 27, 2018, 9:44am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/4 "2018-09-27T09:44:01Z")

</div>

You can use the LookupcommandID function to replicate the function `Split Element` but there is not much interest in doing it with Dynamo.

```
#@nathan.chapman
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

RunIt = IN[0] #Delay execution until selection set etc. has been made

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

#Assign your output to the OUT variable
OUT = errorReport
```

---

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 27, 2018, 10:19am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/5 "2018-09-27T10:19:28Z")

</div>

I only know a little bit of scripting in Dynamo. So I do not understand what u mean with this post.

Can u explain it a little to someone who works with pre-defined nodes ?

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 27, 2018, 10:21am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/6 "2018-09-27T10:21:46Z")

</div>

Run the .dyn file and you will understand what I mean.

[Split Element.dyn](https://forum.dynamobim.com/uploads/short-url/s9ZYYEXXF8JyZU49u1aRVC7FcyT.dyn) (2.3 KB)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 27, 2018, 10:45am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/7 "2018-09-27T10:45:51Z")

</div>

Perhaps add a step 4a to add a connector to the end of the first pipe? I know the command adds the two pieces (the connector and the pipe) in a sequence but I cannot remember what the order is.

---

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 27, 2018, 11:56am UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/8 "2018-09-27T11:56:11Z")

</div>

I ran the script but do not know how to use the node further to tell the node where to split the element.

The only thing I see the script doing is opening the split element command. As I cannot edit the python-code (lack of python- knowledge) , pressing "SL"in Revit is faster. So I do not really see the use of the script.

Can the script be build so that this is the start and after this u give commands (location) where to cut on a given element?

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 27, 2018, 12:02pm UTC](https://forum.dynamobim.com/t/revit-split-line-function-in-dynamo/26461/9 "2018-09-27T12:02:22Z")

</div>

> [@verdi](#):
>
> The only problem is I need the “split” function from revit.

Yep I know. The script can only be useful in very special cases.

@jacob.small’s workflow should suit your needs.
