Set Grid Curves in View


#1

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
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]
View = doc.ActiveView
NewCrvs = list()
TransactionManager.Instance.EnsureInTransaction(doc)

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

TransactionManager.Instance.TransactionTaskDone()

OUT = Levels

Align Grids in View.dyn (24.5 KB)


#2

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