Some projects need to use parts to divide floor tiles, like this:
Using parts can basically calculate quantities and set data such as paving joints, so below 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 parts visibility.
- 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.
- Find the gap parameter and set the value.
Using the above three steps can complete part division and property setting.