Some projects require the use of parts to divide floor tiles, such as this:
Using parts can be a good way to count quantities and set paving joints and other data, so here is a method to create parts.
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();
- First you need to create the missing part
- Add segmentation to the part. Here the line segments do not need to check for collision or closure. You can directly calculate the value and pass in the boundary line.
- Find the para of the gap and set the value
Use the above three steps to complete part division and attribute settings.