Trouble with PolyCurve By Profile Family Type

Hi all - thanks a lot for the effort - I’ll try to get that running (on the road and busy…) - but so I tryed to retype the code and and it stll does not want to work for me…
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

Import ToDSType(bool) extension method

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

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

#name = str(IN[0].Name)
type = UnwrapElement(IN[0].Family.Name)
name = UnwrapElement(IN[0].Name)

family = UnwrapElement(IN[0].Family)

TransactionManager.Instance.ForceCloseTransaction()
famDoc = doc.EditFamily(family)

famCollector = FilteredElementColector(famdoc)
sketch = famCollector.OfClass(Sketch)

for i in sketch
cArray = list(i.profile)
cArray[:] = [[Revit.GeometryConversion.RevitToProtoCurve.ToProtoType (y, True ) for y in x] for x in cArray]
OUT = cArray

run on a profile family returns

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
unexpected token ‘’

maybe i am missing something