I’m trying to control grid line extents using the script worked on in this post:Change grid extents custom node giving null
Im using Dynamo 1.3. Not sure why I get Null in the end.
SetGridExtents_ms.dyn (35.3 KB)
Set Grid Lines_MS.dyf (4.3 KB)
Get Grid Lengths_MS.dyf (3.7 KB)
This is my df code the returns null:
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