Hello,
I can not find the error on the script: unexpected indent
I have a list with a selection, and I would like to know if there is a conflict between the elements.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
#The inputs to this node will be stored as a list in the IN variable.
#dataEnteringNode = IN
clashElementsAdirty=IN[0]
clashElementsBdirty=IN[1]
# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
clashElementsA = []
clashElementsB = []
clashGeomA = []
FailuresA = []
clashGeomB = []
FailuresB = []
clashFoundA = []
clashFoundB = []
for a in clashElementsAdirty:
try:
clashGeomA.append(a.Geometry()[0])
clashElementsA.append(a)
except:
FailuresA.append(a)
for b in clashElementsBdirty:
try:
clashGeomB.append(b.Geometry()[0])
clashElementsB.append(b)
except:
FailuresB.append(b)
counterA = range(len(clashElementsA))
counterB = range(len(clashElementsB))
for i in counterA:
tempGeomA = clashGeomA[i]
j = i + 1
while j =< counterB:
if clashGeomA[i].DoesIntersect(clashGeomB[j]) == True:
clashFoundA.append(clashElementsA[i])
clashFoundB.append(clashElementsB[j])
j = j+1
# End Transaction
TransactionManager.Instance.TransactionTaskDone()
OUT = clashFoundA, clashFoundB, FailuresA, FailuresB