0

I am asked to split a floor or a roof in parts. I am able to do so in a 2D-way, like described in Parts, Assemblies, PartUtils and DivideParts.

This works well. You create a curveList based on a face and DivideParts splits the object in several parts.

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();

I would also like to be able to split an object in a 3D-way. So not only in the X and Y direction but also in the Z-direction.

Since this method is based on a Face and a BoundingBoxUV (2-dimensions), I cannot see what the best way is to proceed.

To make clear what I want to accomplish, I included a picture of a roof, divided in parts bij Revit. I would also like to split the roof indicated by the red line.

Roof divided in Parts

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

After some trial-and-error, I split the roof in separate parts (10 cm thick) and then, I split each part separately in smaller parts of (1m x 1,20m). So it had to be a 2-phase process. It doesn't seem possible to do the same in 1 phase.

Roof split in parts of 10 cm thick

Each part split in parts of 1m by 1,2 m