Set Grid Curves in View


Hello people.
Hopefully someone can help me out. I would like to Edit the Grid Curves in the Active view so the start point is at the left of the crop box and the end point at the right of the crop box.

First I collected the cropbox from the Active view.
With those coordinates i created a new curve for a Python input which I found on this thread: Set Level/Grid Curve by Detail Curves in View

But the script gives an error:
Does someone know whats going wrong?
Thanx in advance.

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. _
Traceback (most recent call last):
_ File “”, line 33, in

Exception: The curve is unbound or not coincident with the original one of the datum plane.
Parameter name: curve

import clr
from Autodesk.Revit.DB import *
import Autodesk

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

import Revit

import DSCore
from DSCore import *

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

Levels = UnwrapElement(IN[0])
Crvs = IN[1]
View = doc.ActiveView
NewCrvs = list()

for c in Crvs:
for l, crv in zip(Levels, NewCrvs):


OUT = Levels

Align Grids in View.dyn (24.5 KB)


I got the same result as you. I think this issue has been tackled here: