Message 1 of 6

Not applicable
04-11-2018
07:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a solid which will be a "bent cylinder", as in a tube that follows along an arc. Here is my attempt:
public Solid CreateSolidFromArc(Document doc, Arc arc) { const double radius = 0.05; XYZ tangent = arc.ComputeDerivatives(0, true).BasisX; var plane = Plane.CreateByNormalAndOrigin(tangent, arc.GetEndPoint(0)); Curve circle0 = Arc.Create(plane, radius, 0, Math.PI); Curve circle1 = Arc.Create(plane, radius, Math.PI, Math.PI * 2.0); var curveLoop = CurveLoop.Create(new List<Curve> { circle0, circle1 }); var loops = new List<CurveLoop> { curveLoop }; var arcCurveLoop = CurveLoop.Create(new List<Curve> {arc}); return GeometryCreationUtilities.CreateSweptGeometry(arcCurveLoop, 0, 0, loops); }
I get this exception:
Autodesk.Revit.Exceptions.InternalException: createSweptSolid failed when creating the Swept solid.
What am I doing wrong?
Solved! Go to Solution.