The Autodesk.Revit.DB.WireframeBuilder
class is a Revit API that provides the ability to build wireframe geometry in a Revit document.
The Autodesk.Revit.DB.WireframeBuilder
class has the following properties:
HasSegments
: Returns true
if the builder has any segments; otherwise, returns false
.Closed
: Gets or sets a value that indicates if the wireframe is closed. If set to true
, the wireframe geometry will be closed and form a closed loop.The Autodesk.Revit.DB.WireframeBuilder
class has several methods for building wireframe geometry:
AddLine
: Adds a line segment to the wireframe builder.AddArc
: Adds an arc segment to the wireframe builder.AddEllipse
: Adds an ellipse segment to the wireframe builder.AddNurbSpline
: Adds a NURB spline segment to the wireframe builder.AddPolyline
: Adds a polyline segment to the wireframe builder.AddRectangle
: Adds a rectangle segment to the wireframe builder.AddCircle
: Adds a circle segment to the wireframe builder.Each method takes the necessary parameters to define the geometry segment, such as start and end points, radius, center point, etc.
Here is an example of using the Autodesk.Revit.DB.WireframeBuilder
class to build a wireframe rectangle:
// create a new wireframe builder object
WireframeBuilder builder = new WireframeBuilder();
// add the four corners of the rectangle
builder.AddLine(new XYZ(0,0,0), new XYZ(10,0,0));
builder.AddLine(new XYZ(10,0,0), new XYZ(10,10,0));
builder.AddLine(new XYZ(10,10,0), new XYZ(0,10,0));
builder.AddLine(new XYZ(0,10,0), new XYZ(0,0,0));
// close the wireframe geometry to form a closed loop
builder.Closed = true;
// create a new detail line in the Revit document using the wireframe geometry
DetailLine detailLine = doc.Create.NewDetailCurve(view, builder.ToCurveArray()[0]) as DetailLine;
In this example, we create a new WireframeBuilder
object and add four line segments to build a rectangle. We then set builder.Closed
to true
to close the wireframe geometry, and use the ToCurveArray()
method to generate a curve array that can be used to create a DetailLine
in the Revit document.