How can I cast Geometry.Line to Revit.DB.Curve

I am still juggling through PartUtils and cannot make it work. Here is what happens.

  1. I have elements in Revit (floors) as well as model lines (area boundary lines)
  2. I have managed to select all elements and also select all area boundary lines and extract those as curves or just get their element IDs.
  3. I used a pyhton Script to access PartUtils and use the DivideParts method where the boundary lines were supposed to be the dividision sketch.

The error I have stumbled upon now is unable to cast object of type Geometry or Model line to Autodesk DB Curve

the script is here (original by Konrad S)

#Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory,

import clr
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Analysis import *

from System.Collections.Generic import List

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

# Import ToDSType(bool) extension method
import Revit

# Import ToProtoType, ToRevitType geometry conversion extension methods

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

ElementsToBeParted = UnwrapElement(IN[0])
divisionLines = UnwrapElement(IN[1])
sketchPlane = UnwrapElement(IN[2])

#Define the division function to process
elementList = List[ElementId]()
intersectionElementsIds = List[ElementId]()
curveArray = List[Curve](divisionLines)


if PartUtils.AreElementsValidForCreateParts(doc, elementList):
	createParts = PartUtils.CreateParts(doc, elementList)
parts = PartUtils.GetAssociatedParts(doc, ElementsToBeParted.Id, 0, 0)
dividedParts = PartUtils.DivideParts(doc, parts, intersectionElementsIds, curveArray, sketchPlane.Id)

OUT = dividedParts