# BooleanOperationsUtils is not defined

**URL:** <https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240>\
**Category:** Revit\
**Tags:** python, dynamo\
**Created:** [July 15, 2021, 2:40pm UTC](https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240 "2021-07-15T14:40:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![d.feyerer](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@d.feyerer](https://forum.dynamobim.com/u/d.feyerer)\
**Post date:** [July 15, 2021, 2:40pm UTC](https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240/1 "2021-07-15T14:40:56Z")

</div>

Thanks in advance for every input.

I tried to use

_BooleanOperationsUtils.ExecuteBooleanOperation(arg1, arg2, BooleanOperationsType.Intersect)_

to evaluate if a solid gets intersected by another solid. (Later i want to use it to compare the whole list)

Do i miss some necessary imports in PythonScript, or what could be the problem here?

Input Parameters are 2 non-nested lists with solids as items.

```auto
import sys
import clr
clr.AddReference('ProtoGeometry')
clr.AddReference('RevitAPI')
from Autodesk.DesignScript.Geometry import *

rooms = IN[0]
gds = IN[1]

a = rooms[0]
b = gds[0]

val = BooleanOperationsUtils.ExecuteBooleanOperation(a, b, BooleanOperationsType.Intersect)

OUT = val

```

---

<div class="post-metadata">

**Author:** ![AmolShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/amolshah/32/103244_2.png) [@AmolShah](https://forum.dynamobim.com/u/AmolShah)\
**Post date:** [July 15, 2021, 2:59pm UTC](https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240/2 "2021-07-15T14:59:57Z")

</div>

@d.feyerer Try adding `from Autodesk.Revit.DB import *`  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/8/a8b217f24bec2d249301fe28d955af18cdfebc46.png)

---

<div class="post-metadata">

**Author:** ![d.feyerer](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@d.feyerer](https://forum.dynamobim.com/u/d.feyerer)\
**Post date:** [July 16, 2021, 7:10am UTC](https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240/3 "2021-07-16T07:10:45Z")

</div>

Thank you for your answer, first error wasn´t shown again.

But now i have another error message, which quite confuses me:

 ![problem1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/4/a4be2c6d00ca395f2e2eb069a69cba0c82aa8a6e.png)

“Expected Solid, got Solid” → ?

What does that mean? Are there different Types of “Solid”?

I used Object.Type node and it shows, that the items of both lists got type:  
**Autodesk.DesignScript.Geometry.Solid**

[CUSTOMWriteSlabTagsToRooms\_adaptions.dyn](https://forum.dynamobim.com/uploads/short-url/kzXOqjIVY3JlqT6Y4SycZ6SMcNZ.dyn) (148.8 KB)

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [July 16, 2021, 9:01am UTC](https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240/4 "2021-07-16T09:01:26Z")

</div>

Yes: You are inputting a Dynamo Solid from its ProtoGeometry library where as the Revit API BooleanOperationsUtils.ExecuteBooleanOperation method expects a Revit API Solid. Try calling ToRevitType() on the Proto Solid, just don’t expect very reliable results as it will fail conversion often.

---

<div class="post-metadata">

**Author:** ![d.feyerer](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@d.feyerer](https://forum.dynamobim.com/u/d.feyerer)\
**Post date:** [July 16, 2021, 12:01pm UTC](https://forum.dynamobim.com/t/booleanoperationsutils-is-not-defined/66240/5 "2021-07-16T12:01:35Z")

</div>

@Thomas_Mahon

I´ve found a wiki entry on [github.com](http://github.com), where you have described the transformation from Dynamo Geometry to Revit GeometryObject instances ( [Python 0.6.3 to 0.7.x Migration · DynamoDS/Dynamo Wiki · GitHub](https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#geometryobjects))

I managed to transform the Dynamo Solids to Revit Solids with this approach (for one item). I am actually testing the approach if it produces stable results.

```auto
import sys
import clr

clr.AddReference("RevitAPI")
import Autodesk

clr.AddReference("RevitNodes")
import Revit

clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('ProtoGeometry')
clr.ImportExtensions(Revit.GeometryConversion)

from Autodesk.Revit.DB import *
from Autodesk.DesignScript.Geometry import *

rooms = IN[0]
gds = IN[1]

a = UnwrapElement(rooms[0])
a2 = a.ToRevitType(TessellatedShapeBuilderTarget.Solid, TessellatedShapeBuilderFallback.Abort)
a3 = a2[0]

b = UnwrapElement(gds[0][0])
b2 = b.ToRevitType(TessellatedShapeBuilderTarget.Solid, TessellatedShapeBuilderFallback.Abort)
b3 = b2[0]

val = BooleanOperationsUtils.ExecuteBooleanOperation(a3, b3, BooleanOperationsType.Intersect)
		
OUT = val, a3, b3

```
