Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
We are facing an exception error when executing brepBuilder.FinishFace() in our program with Revit API.
Any advice and/or suggestions to solve this issue will be appreciated.
Please find attached an image file which describes details of the geometry shapes to be generated by this program.
Here under inserted the source code.
The exception error "Face covers a full period of a periodic coordinate. Parameter name: faceId" happens in the step
when the red line portion in the code is executed.
Thanks and regards,
#region "face6 color=orange" curface = "orange"; { // Create CylindricalSurface XYZ origin = new XYZ(10.996980, 0.000000, -10.99531); XYZ normal = new XYZ(0, -1, 0); XYZ xvec = new XYZ(-1, 0, 0); XYZ yvec = new XYZ(0, 0, -1); double radius = 6; Frame basis = new Frame(origin, xvec, yvec, normal); CylindricalSurface cylSurf = CylindricalSurface.Create(basis, radius); // face bool bFaceIsReversed = true; BRepBuilderGeometryId faceId = brepBuilder.AddFace(BRepBuilderSurfaceGeometry.Create(cylSurf, null), bFaceIsReversed); // set face color as orange ElementId materialId = GetColoredMaterialId(255, 159, 0); brepBuilder.SetFaceMaterialId(faceId, materialId); // Loops BRepBuilderGeometryId loopId = brepBuilder.AddLoop(faceId); // edge { //BRepBuilderEdgeGeometry edge = BRepBuilderEdgeGeometry.Create(new XYZ(11.234278, 300.000000, -5.000000), new XYZ(11.234278, 0.000000, -5.000000)); //edgeId_f5_3 = brepBuilder.AddEdge(edge); brepBuilder.AddCoEdge(loopId, edgeId_f5_3, true); } { XYZ end0 = new XYZ(11.234278, 0.000000, -5.000000); XYZ end1 = new XYZ(5.000000, 0.000000, -11.185635); XYZ pointOnArc = new XYZ(6.770989, 0.000000, -6.736081); Arc arc = Arc.Create(end0, end1, pointOnArc); BRepBuilderEdgeGeometry edge = BRepBuilderEdgeGeometry.Create(arc); edgeId_f6_2 = brepBuilder.AddEdge(edge); brepBuilder.AddCoEdge(loopId, edgeId_f6_2, false); } { BRepBuilderEdgeGeometry edge = BRepBuilderEdgeGeometry.Create(new XYZ(5.000000, 0.000000, -11.185635), new XYZ(5.000000, 300.000000, -11.185635)); edgeId_f6_3 = brepBuilder.AddEdge(edge); brepBuilder.AddCoEdge(loopId, edgeId_f6_3, false); } { XYZ end0 = new XYZ(5.000000, 300.000000, -11.185635); XYZ end1 = new XYZ(11.234278, 300.000000, -5.000000); XYZ pointOnArc = new XYZ(15.222972, 300.000000, -15.254530); Arc arc = Arc.Create(end0, end1, pointOnArc); BRepBuilderEdgeGeometry edge = BRepBuilderEdgeGeometry.Create(arc); edgeId_f6_4 = brepBuilder.AddEdge(edge); brepBuilder.AddCoEdge(loopId, edgeId_f6_4, false); } brepBuilder.FinishLoop(loopId); brepBuilder.FinishFace(faceId); } #endregion
Solved! Go to Solution.