Hi @AlexWer

You can try something like this, done in a C# comp, which you can easily copy paste in to your VS project.

```
/// <summary>
///
/// </summary>
/// <param name="subtractFrom"></param>
/// <param name="subtractWith"></param>
/// <param name="tolerance"></param>
/// <param name="parallel"></param>
/// <returns></returns>
public DataTree<Brep> SolidDifference(DataTree<Brep> subtractFrom, DataTree<Brep> subtractWith, double tolerance, bool parallel)
{
DataTree<Brep> result = new DataTree<Brep>();
if(parallel ==false)
{
result = BoolDifference(subtractFrom, subtractWith, tolerance);
}
else
{
result = BoolDifferenceParallel(subtractFrom, subtractWith, tolerance);
}
return result;
}
/// <summary>
///
/// </summary>
/// <param name="subtractFrom"></param>
/// <param name="subtractWith"></param>
/// <param name="tolerance"></param>
/// <returns></returns>
private DataTree<Brep> BoolDifference(DataTree<Brep> subtractFrom, DataTree<Brep> subtractWith, double tolerance)
{
DataTree<Brep> result = new DataTree<Brep>();
for (int i = 0; i < subtractWith.BranchCount; i++)
{
for (int j = 0; j < subtractWith.Branch(i).Count; j++)
{
for (int k = 0; k < subtractFrom.BranchCount; k++)
{
for (int m = 0; m < subtractFrom.Branch(k).Count; m++)
{
if(subtractFrom.Branch(k)[m].IsValid == false)
{
throw new ArgumentException("Input a valid Brep to substract from!");
}
if(subtractWith.Branch(i)[j].IsValid == false)
{
throw new ArgumentException("Input a valid Brep to substract with!");
}
Brep [] diff = Brep.CreateBooleanDifference(subtractFrom.Branch(k)[m], subtractWith.Branch(i)[j], tolerance);
result.AddRange(diff, new GH_Path(k));
}
}
}
}
return result;
}
/// <summary>
///
/// </summary>
/// <param name="subtractFrom"></param>
/// <param name="subtractWith"></param>
/// <param name="tolerance"></param>
/// <returns></returns>
private DataTree<Brep> BoolDifferenceParallel(DataTree<Brep> subtractFrom, DataTree<Brep> subtractWith, double tolerance)
{
DataTree<Brep> result = new DataTree<Brep>();
Parallel.For(0, subtractWith.BranchCount, i =>
{
for (int j = 0; j < subtractWith.Branch(i).Count; j++)
{
for (int k = 0; k < subtractFrom.BranchCount; k++)
{
for (int m = 0; m < subtractFrom.Branch(k).Count; m++)
{
if(subtractFrom.Branch(k)[m].IsValid == false)
{
throw new ArgumentException("Input a valid Brep to substract from!");
}
if(subtractWith.Branch(i)[j].IsValid == false)
{
throw new ArgumentException("Input a valid Brep to substract with!");
}
Brep [] diff = Brep.CreateBooleanDifference(subtractFrom.Branch(k)[m], subtractWith.Branch(i)[j], tolerance);
result.AddRange(diff, new GH_Path(k));
}
}
}
});
return result;
```

which is used as

```
private void RunScript(DataTree<Brep> substract, DataTree<Brep> solid, ref object A)
{
double docTol = RhinoDocument.ModelAbsoluteTolerance;
A = SolidDifference(substract, solid, docTol,parallel);
}
```

- make sure you have
`using System.Threading.Tasks;`

to be able to use the `Parallel`

class