【发布时间】:2016-11-29 21:48:03
【问题描述】:
我被要求将地板或屋顶分成几部分。我可以像Parts, Assemblies, PartUtils and DivideParts 中描述的那样以二维方式这样做。
这很好用。您基于一个面创建一个曲线列表,然后 DivideParts 将对象分成几个部分。
foreach( Face face in faceArray )
{
// find the center of the face
BoundingBoxUV bbox = face.GetBoundingBox();
// Some other code
}
// Create the curves that will be used for the part division.
IList<Curve> curveList = new List<Curve>();
Curve curve1 = app.Create.NewLine( pointCenter, pointRight, true );
curveList.Add( curve1 );
Curve curve2 = app.Create.NewLine( pointRight, pointCorner, true );
curveList.Add( curve2 );
Curve curve3 = app.Create.NewLine( pointCorner, pointTop, true );
curveList.Add( curve3 );
Curve curve4 = app.Create.NewLine( pointTop, pointCenter, true );
curveList.Add( curve4 );
// intersectingReferenceIds will be empty for this example.
ICollection<ElementId> intersectingReferenceIds = new List<ElementId>();
// Divide the part
Transaction dividePartTransaction = new Transaction( doc, "Divide Part" );
dividePartTransaction.Start();
PartMaker maker = PartUtils.DivideParts( doc, elementIdsToDivide, intersectingReferenceIds, curveList, sketchPlane.Id );
dividePartTransaction.Commit();
我还希望能够以 3D 方式拆分对象。所以不仅在 X 和 Y 方向上,而且在 Z 方向上。
由于此方法基于 Face 和 BoundingBoxUV(二维),我看不出最好的方法是什么。
为了明确我想要完成的任务,我附上了一张屋顶的图片,分为几部分 bij Revit。我也想拆分红线所示的屋顶。
【问题讨论】: