Hi,
Thanks Jeremy. Yes i feel i'm almost there. The progress i've made is creating Tessellated faces (see earlier posts)
With the same ShapeBuilder i now can build non triangled faces, only if they are planar (see image1, simple box) and they are individually selectable, what i need!
When using this with an object that doesn't have all planar faces you see it not creates all the single faces (image2)
The result i need is the same as image3 but this is a solid shape and i need individually faces. So the conclusion for now is that Tessellated builder can't build my non planar shape in individually faces that aren't triangled. Anyone an idea what the right builder?



List<Solid> sol = new List<Solid>();
Solid loft = GeometryCreationUtilities.CreateLoftGeometry(profileLoop, options);
sol.Add(loft);
foreach (Solid s in sol)
{
foreach (Face f in s.Faces)
{
Build_Tessellate2(f);
ElementId categoryId = new ElementId(BuiltInCategory.OST_GenericModel);
DirectShape ds = DirectShape.CreateElement(doc, categoryId);
ds.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetType().GUID.ToString();
ds.ApplicationDataId = Guid.NewGuid().ToString();
foreach (TessellatedShapeBuilderResult t1 in Build_Tessellate2(f))
{
ds.SetShape(t1.GetGeometricalObjects());
ds.Name = "Single_Surface";
}
}
}
public List<TessellatedShapeBuilderResult> Build_Tessellate2(Face faces)
{
Mesh mesh = faces.Triangulate();
List<XYZ> vert = new List<XYZ>();
foreach (XYZ ij in mesh.Vertices)
{
XYZ vertices = ij;
vert.Add(vertices);
}
TessellatedShapeBuilder builder = new TessellatedShapeBuilder();
builder.OpenConnectedFaceSet(false);
//Filter for Title Blocks in active document
FilteredElementCollector materials = new FilteredElementCollector(m_revit.Application.ActiveUIDocument.Document)
.OfClass(typeof(Autodesk.Revit.DB.Material))
.OfCategory(BuiltInCategory.OST_Materials);
ElementId materialId = materials.First().Id;
builder.AddFace(new TessellatedFace(vert, materialId));
builder.CloseConnectedFaceSet();
builder.Target = TessellatedShapeBuilderTarget.AnyGeometry;
builder.Fallback = TessellatedShapeBuilderFallback.Mesh;
builder.Build();
TessellatedShapeBuilderResult result3 = builder.GetBuildResult();
List<TessellatedShapeBuilderResult> res = new List<TessellatedShapeBuilderResult>();
if (result3.Outcome.ToString() == "Sheet")
{
res.Add(result3);
}
return res;
}