Grid extend set for multiple view

Hi,

I try to Set grid extend in view. I was successful in set it in active view. but when i set up for multiple view. I got error. any help with the python or node that allow me to do is appreciated.

here the python code

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

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

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

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

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

grids = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])
crvs = UnwrapElement(IN[2])

curves = []
curvesViews = []

TransactionManager.Instance.EnsureInTransaction(doc)

for i in range(0,len(grids)):	
grids[i].SetCurveInView(DatumExtentType.ViewSpecific,view,crvs[i])

TransactionManager.Instance.TransactionTaskDone()

#Assign your outputs to the OUT variable
OUT = grids

I got it to run but not able to set it. Any though?

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

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('DSCoreNodes')
import DSCore
from DSCore import *

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

Levels = UnwrapElement(IN[0])
Crvs = IN[1]
NewCrvs = list()
viewlist = list()

TransactionManager.Instance.EnsureInTransaction(doc)

if isinstance(IN[2], list):
for v in IN[2]:
viewlist.append(UnwrapElement(v))
else:
viewlist.append(UnwrapElement(IN[2]))

for c in Crvs:
NewCrvs.append(c.ToRevitType())
for l, crv, View in zip(Levels, NewCrvs, viewlist):
l.SetCurveInView(DatumExtentType.ViewSpecific,View,crv)

TransactionManager.Instance.TransactionTaskDone()

OUT = Levels