# Converting OOTB Revit Node to Python - CurveElement.Curve

**URL:** <https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762>\
**Category:** Developers\
**Tags:** revit, python\
**Created:** [April 10, 2021, 11:00pm UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762 "2021-04-10T23:00:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![djforeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/djforeman/32/132835_2.png) [@djforeman](https://forum.dynamobim.com/u/djforeman)\
**Post date:** [April 10, 2021, 11:00pm UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762/1 "2021-04-10T23:00:53Z")

</div>

I’m working on a graph and at the same time trying to improve my python skills.

So I’m attempting to take some of the OOTB Revit nodes and convert them to code in a Python Node.

So what I have so far is a list of elements. For my example they are just Detail Lines.  
I’m inputting that list into a Python node and then looping through the list attempting to extract the curve of the element.

So my code:

```
# Load the Python Standard and DesignScript Libraries
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import RevitNodes
clr.AddReference("RevitNodes")
import Revit

# Import Revit elements
from Revit.Elements import *

# Import DocumentManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

import System

# The inputs to this node will be stored as a list in the IN variables.

inCurves = list(UnwrapElement(IN[0]))

test = []

for x in inCurves:
	
	temp = Revit.Elements.CurveElement(x)
	test.append(temp)

OUT = test

```

Using the OOTB node I end up with the curve of the Detail Lines, but using the code I get an error. Not sure why, but also not sure if my code is right.

Error:

> TypeError: Cannot create instances of CurveElement because it is abstract

---

<div class="post-metadata">

**Author:** ![djforeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/djforeman/32/132835_2.png) [@djforeman](https://forum.dynamobim.com/u/djforeman)\
**Post date:** [April 10, 2021, 11:01pm UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762/2 "2021-04-10T23:01:29Z")

</div>

Here is a screenshot of the OOTB node and the Python node as well.

![CurveElement-Error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/e/7ee2a56ad507ca4bf4ef2dcc3797d2222fc402a0.png)

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [April 11, 2021, 9:32am UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762/3 "2021-04-11T09:32:57Z")

</div>

Hello  
here an example

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/a/ca7adc9b9f227ed10173390e430fa17150c5b44a.png)

---

<div class="post-metadata">

**Author:** ![djforeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/djforeman/32/132835_2.png) [@djforeman](https://forum.dynamobim.com/u/djforeman)\
**Post date:** [April 11, 2021, 5:24pm UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762/4 "2021-04-11T17:24:08Z")

</div>

I tried your suggestion and I end up with an empty list as a result.

 ![test_OOTB](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/7/b7923a59a987fc49ccff48174452b01c1312cd11.png)

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [April 11, 2021, 5:33pm UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762/5 "2021-04-11T17:33:13Z")

</div>

Hello  
because you have already a list at input IN[0],  
change  
`inCurves = [IN[0]]`  
to  
`inCurves = IN[0]`  
or implement a logical condition

---

<div class="post-metadata">

**Author:** ![djforeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/djforeman/32/132835_2.png) [@djforeman](https://forum.dynamobim.com/u/djforeman)\
**Post date:** [April 12, 2021, 12:39am UTC](https://forum.dynamobim.com/t/converting-ootb-revit-node-to-python-curveelement-curve/62762/6 "2021-04-12T00:39:21Z")

</div>

Thank you so much.

That works perfectly.
