Some projects need to use parts to divide floor tiles, like this:

![Image Description](https://cdn.bimath.com/blog/pg/Snipaste_2026-01-04_16-50-02.png)
Using parts can basically calculate quantities and set data such as paving joints, so below is a method to create parts.
1
2
3
4
5
6
7
8
9
10
11
12
13
PartUtils.CreateParts(doc,new List<ElementId>(){detailFloor.Id});

doc.Regenerate();

var elementIds = PartUtils.GetAssociatedParts(doc, detailFloor.Id, true, true);

var maker = PartUtils.DivideParts(doc, elementIds, new List<ElementId>() { },
curves, ske.Id);

var para = maker.get_Parameter(BuiltInParameter.PARTMAKER_PARAM_DIVISION_GAP);
para.Set(cranny);

doc.Regenerate();
  1. First, you need to create parts visibility.
  2. Add divisions in parts. The line segments here do not need to check for collisions or closure, directly calculate the value and boundary lines and pass them in.
  3. Find the gap parameter and set the value.

Using the above three steps can complete part division and property setting.