Hi
I am using Clockwork’s ‘SpotElevation.ByFloorPlanAndPoint’ node to add a spot elevation to a stair landing. It runs fine in Manual mode but when I switch to Automatic model is crashes Revit and Dynamo. I’m using Revit 2018, Dynamo 1.3.3, and Clockwork v1.31.1.
This is the Python script within the node. Is there any reason it would be causing it to crash? @Andreas_Dieckmann
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
views = UnwrapElement(IN[0])
pts = UnwrapElement(IN[1])
bend = UnwrapElement(IN[2])
end = UnwrapElement(IN[3])
leader = UnwrapElement(IN[4])
isoview = UnwrapElement(IN[5])
intsecvec = UnwrapElement(IN[6])
elementlist = []
i = 0;
TransactionManager.Instance.EnsureInTransaction(doc)
for pt in pts:
view = views[i]
pt = pt.ToXyz()
refintsec = ReferenceIntersector(isoview)
refintsec.TargetType = FindReferenceTarget.Face
try:
ref = refintsec.FindNearest(pt,intsecvec[i].AsPoint().ToXyz()).GetReference()
elementlist.append(doc.Create.NewSpotElevation(view, ref, pt, pt.Add(bend.AsPoint().ToXyz()), pt.Add(end.AsPoint().ToXyz()), pt, leader))
except:
elementlist.append(None)
i += 1
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist