【Revit 技巧】编程创建填充区域
Revit 2013 API提供了一个新功能用FilledRegion.Create() 方法来创建填充区域。
函数的签名如下:
public static FilledRegion Create(
Document document,
ElementId typeId,
ElementId viewId,
IList<CurveLoop> boundaries
)北京英孚教育
调用这个函数之前,需要预备好填充区域的填充类型(FilledRegionType) id, 放在在哪个文档的那个视图中,以及填充区域的边界封闭曲线。初中英语说课稿模板
下面的代码展示了如何创建
FilteredElementCollector collector = new FilteredElementCollector(_doc);
IList<Element> fillRegionTypes =
collector.OfClass(typeof(FilledRegionType)).ToElements();
IEnumerable<FilledRegionType> myPatterns =
noble什么意思
from pattern in fillRegionTypes.Cast<FilledRegionType>()
where pattern.Name.Equals("Diagonal Crosshatch")
lect pattern;
foreach (FilledRegionType frt in fillRegionTypes)
{
List<CurveLoop> profileloops = new List<CurveLoop>();agrarian
numb伴奏XYZ[] points = new XYZ[5];
points[0] = new XYZ(0.0, 0.0, 0.0);manifesto
points[1] = new XYZ(10.0, 0.0, 0.0);
points[2] = new XYZ(10.0, 10.0, 0.0);
points[3] = new XYZ(0.0, 10.0, 0.0);
points[4] = new XYZ(0.0, 0.0, 0.0);
CurveLoop profileloop = new CurveLoop();
for (int i = 0; i < 4; i++)
{alcoholfree
johnny hallydayLine line = _app.Create.NewLineBound(points[i], points[i + 1]);
profileloop.Append(line);电荷密度
}
pursue用法
profileloops.Add(profileloop);
ElementId activeViewId = _doc.ActiveView.Id;
FilledRegion filledRegion = FilledRegion.Create(_doc, frt.Id, activeViewId, profileloops);
break; }