I'm sorry I've been busy with something else lately, and I can't reply to you until now.
I have wrote a test code and found that I still couldn't create a sweep with three closed loops. Here's the code:
public Sweep CreateSweep_EmptyTest(Autodesk.Revit.ApplicationServices.Application app,Autodesk.Revit.DB.Document doc)
{
CurveArray path = new CurveArray();
path.Append(Line.CreateBound(new XYZ(0, 0, 0), new XYZ(0, 5, 0)));
XYZ p1 = new XYZ(0, 0, 0);
XYZ p2 = new XYZ(10, 0, 0);
XYZ p3 = new XYZ(10, 15, 0);
XYZ p4 = new XYZ(0, 15, 0);
XYZ a1 = new XYZ(1, 5, 0);
XYZ a2 = new XYZ(3, 5, 0);
XYZ a3 = new XYZ(3, 10, 0);
XYZ a4 = new XYZ(1, 10, 0);
XYZ b1 = new XYZ(5, 5, 0);
XYZ b2 = new XYZ(7, 5, 0);
XYZ b3 = new XYZ(7, 10, 0);
XYZ b4 = new XYZ(5, 10, 0);
Sweep sweep = null;
CurveArrArray arrcurve = new CurveArrArray();
CurveArray curve = new CurveArray();
curve.Append(Line.CreateBound(p1, p2));
curve.Append(Line.CreateBound(p2, p3));
curve.Append(Line.CreateBound(p3, p4));
curve.Append(Line.CreateBound(p4, p1));
//curve.Append(Line.CreateBound(a1, a2));
//curve.Append(Line.CreateBound(a2, a3));
//curve.Append(Line.CreateBound(a3, a4));
//curve.Append(Line.CreateBound(a4, a1));
curve.Append(Line.CreateBound(a1, a4));
curve.Append(Line.CreateBound(a4, a3));
curve.Append(Line.CreateBound(a3, a2));
curve.Append(Line.CreateBound(a2, a1));
//curve.Append(Line.CreateBound(b1, b2));
//curve.Append(Line.CreateBound(b2, b3));
//curve.Append(Line.CreateBound(b3, b4));
//curve.Append(Line.CreateBound(b4, b1));
curve.Append(Line.CreateBound(b1, b4));
curve.Append(Line.CreateBound(b4, b3));
curve.Append(Line.CreateBound(b3, b2));
curve.Append(Line.CreateBound(b2, b1));
arrcurve.Append(curve);
SweepProfile profile = m_revit.Create.NewCurveLoopsProfile(arrcurve);
Autodesk.Revit.DB.XYZ normal = Autodesk.Revit.DB.XYZ.BasisZ;
SketchPlane sketchPlane = CreateSketchPlane(normal, XYZ.Zero);
sweep = doc.FamilyCreate.NewSweep(true, path, sketchPlane, profile, 0, ProfilePlaneLocation.Start);
return sweep;
}
I have run it with these conditions that the square outside is counterclockwise and the inner a is clockwise,the inner b is counterclockwise or the square outside is counterclockwise and the inner a is counterclockwise ,the inner b is clockwise or the square outside is counterclockwise, the inner a and inner b both clockwise,they all failed.
If the inside and outside are opposite with two closed loops,they can always be successfully.
I can not solve the problem, i need your help,thank you.