# Python script error: unexpected indent

**URL:** <https://forum.dynamobim.com/t/python-script-error-unexpected-indent/9884>\
**Category:** Developers\
**Created:** [February 24, 2017, 7:24am UTC](https://forum.dynamobim.com/t/python-script-error-unexpected-indent/9884 "2017-02-24T07:24:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alain\_Hamel](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Alain\_Hamel](https://forum.dynamobim.com/u/Alain_Hamel)\
**Post date:** [February 24, 2017, 7:24am UTC](https://forum.dynamobim.com/t/python-script-error-unexpected-indent/9884/1 "2017-02-24T07:24:59Z")

</div>

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

```

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/66366b68d4cfe92803936dcd33c1db449bc606c1.png)

---

<div class="post-metadata">

**Author:** ![T\_Pover](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/t_pover/32/19147_2.png) [@T\_Pover](https://forum.dynamobim.com/u/T_Pover)\
**Post date:** [February 24, 2017, 8:19am UTC](https://forum.dynamobim.com/t/python-script-error-unexpected-indent/9884/2 "2017-02-24T08:19:58Z")

</div>

On line 63 the while loop is indented once too many.

---

<div class="post-metadata">

**Author:** ![Alain\_Hamel](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Alain\_Hamel](https://forum.dynamobim.com/u/Alain_Hamel)\
**Post date:** [February 24, 2017, 12:10pm UTC](https://forum.dynamobim.com/t/python-script-error-unexpected-indent/9884/3 "2017-02-24T12:10:18Z")

</div>

Hello  
Thank you for your answer, but that does not seem to be the cause.  
The paste code in the WEB does not exactly match the drop in Dynamo.

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/f/8/f8e5ae45b1059cb1f912fb56150bbf539806d605.PNG)

---

<div class="post-metadata">

**Author:** ![T\_Pover](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/t_pover/32/19147_2.png) [@T\_Pover](https://forum.dynamobim.com/u/T_Pover)\
**Post date:** [February 24, 2017, 12:22pm UTC](https://forum.dynamobim.com/t/python-script-error-unexpected-indent/9884/4 "2017-02-24T12:22:53Z")

</div>

The error disappeared after I changed the indents there. It did result in new error though, the \< and = on line 62 have to be switched around. After that you’ll need to input a second list of elements in the second input.  
After that my computer crashed, so that’s how far I’ve gotten up till now.
