I’m trying to place some reveals in walls using a node from Data-shapes which is largely a python script calling the WallSweep.create method - it appears to be creating the sweeps well but I’m having a very tough time figuring out why the distance from the end of the walls is inconsistent. Testing in a clean project it works great, but when I got to a larger test/live project the reveals are placed at varying distances even after I filter the walls re: their placement direction. Any thoughts are welcome as to why this might be happening or how to get around it
This is the text from the Python Node
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import*
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
if isinstance(IN[0],list):
walls = [UnwrapElement(i) for i in IN[0]]
else:
walls = [UnwrapElement(IN[0])]
wstype = ElementId(IN[1].Id)
sr = IN[2]
vertical = IN[3]
UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits
dist = UnitUtils.ConvertToInternalUnits(IN[4],UIunit)
#creating wallsweepinfo
if not sr:
wsi = WallSweepInfo(WallSweepType.Sweep,vertical)
else:
wsi = WallSweepInfo(WallSweepType.Reveal,vertical)
#setting distance of sweep
wsi.Distance = dist
#creating wallsweep
TransactionManager.Instance.EnsureInTransaction(doc)
ws =
for w in walls:
ws.append(WallSweep.Create(w,wstype,wsi))
TransactionManager.Instance.TransactionTaskDone()
OUT = ws