# Boolean operation not working

Good morning guys, I’m new in the forum and in Grasshopper development, but I’m quite experinced in other platforms.
Can anyone try to explain me why this simple boolean operation is not working?
I’m creating two conceantric solids (breps) capped on both sided and I’m rying to subtract one from the other.
The solid are created from loft operation between two circles (the circles are oriented by planes). In Dynamo is simple to obtain this operation…why here not? Am I missing something?

``````protected override void SolveInstance(IGH_DataAccess DA)
{
double ringAverageLength = double.NaN;
double concreteThickness = double.NaN;
int connectors = -1;
int segments = -1;
//List<List<int>> positionMatrix = new List<List<int>>();

if (!DA.GetData(0, ref designRadius)) { return; }
if (!DA.GetData(1, ref ringAverageLength)) { return; }
if (!DA.GetData(2, ref ringInternalRadius)) { return; }
if (!DA.GetData(3, ref concreteThickness)) { return; }
if (!DA.GetData(4, ref connectors)) { return; }
if (!DA.GetData(5, ref segments)) { return; }

int rotations = connectors * segments;
double rotAngle = (360.0 / (rotations));
double keyRotationAngle = rotAngle / 2;

List<Plane> planes = new List<Plane>();

Point3d p1 = new Point3d(0, 0, ringAverageLength / 2);
Point3d p2 = -p1;

Plane pl1 = new Plane(p1, Vector3d.ZAxis);
Plane pl2 = new Plane(p2, Vector3d.ZAxis);

Transform tr1 = Transform.Rotation(Utils.Utils.DegToRad(alpha), pl1.XAxis, p1);
Transform tr2 = Transform.Rotation(-Utils.Utils.DegToRad(alpha), pl1.XAxis, p2);
pl1.Transform(tr1);
pl2.Transform(tr2);

NurbsCurve cc1 = new Circle(pl1, ringInternalRadius).ToNurbsCurve();
NurbsCurve cc2 = new Circle(pl2, ringInternalRadius).ToNurbsCurve();

NurbsCurve cc3 = new Circle(pl1, ringInternalRadius + concreteThickness).ToNurbsCurve();
NurbsCurve cc4 = new Circle(pl2, ringInternalRadius + concreteThickness).ToNurbsCurve();

List<Curve> intCurves = new List<Curve>();

List<Curve> extCurves = new List<Curve>();

Brep intbreps = Brep.CreateFromLoft(intCurves, Point3d.Unset, Point3d.Unset, LoftType.Tight, false).ToList()[0].CapPlanarHoles(0);
Brep extbreps = Brep.CreateFromLoft(extCurves, Point3d.Unset, Point3d.Unset, LoftType.Tight, false).ToList()[0].CapPlanarHoles(0);

List<Brep> bb = new List<Brep>();

var breps = Brep.CreateBooleanDifference(extbreps, intbreps, RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
DA.SetDataList(0, breps);
}``````

If you bake your extbreps and intbreps shapes using `RhinoDoc.ActiveDoc.Objects.AddBrep(extbreps);` do you get the shapes you were expecting? Does the Rhino `_BooleanDifference` command work on those shapes?

I’ve got the final result!

``````Brep intbreps = Brep.CreateFromLoft(intCurves, Point3d.Unset, Point3d.Unset, LoftType.Tight, false).ToList()[0].
CapPlanarHoles(RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
Brep extbreps = Brep.CreateFromLoft(extCurves, Point3d.Unset, Point3d.Unset, LoftType.Tight, false).ToList()[0].
CapPlanarHoles(RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);

List<Brep> bb = new List<Brep>();