Autodesk.Revit.DB.Profile
是Revit的API中用于创建和修改剖面的类。
Curve
:剖面的曲线。可以是Line
,Arc
或NurbSpline
。IsSolid
:是否为实体剖面。SetSegments
:设置剖面的线段。接受参数为IList<Curve>
。AddSegment
:向剖面中添加一个线段。接受参数为Curve
。Erase
:删除剖面。//创建三角形剖面
Line line1 = Line.CreateBound(new XYZ(0, 0, 0), new XYZ(10, 0, 0));
Line line2 = Line.CreateBound(new XYZ(10, 0, 0), new XYZ(5, 10, 0));
Line line3 = Line.CreateBound(new XYZ(5, 10, 0), new XYZ(0, 0, 0));
IList<Curve> segments = new List<Curve> { line1, line2, line3 };
Profile profile = Profile.Create(segments);
//向已创建的剖面添加线段
Line line4 = Line.CreateBound(new XYZ(0, 0, 0), new XYZ(0, 10, 0));
profile.AddSegment(line4);