opt = Options()
opt.IncludeNonVisibleObjects = True
faces = s0.get_Geometry(opt).Cast[Solid]().Where(lambda x: x.Volume < 0.001).Select(lambda x: x.Faces.get_Item(0)).Where(lambda x: x.ComputeNormal(UV.Zero).CrossProduct(s0.Orientation).IsAlmostEqualTo(XYZ.Zero)).ToList()
print faces.Count
def DrawFace(face):
cl = face.GetEdgesAsCurveLoops().Single()
if not(cl.HasPlane()):
return
p = cl.GetPlane()
print p.Normal
sp = SketchPlane.Create(doc, p)
for c in cl:
doc.Create.NewModelCurve(c, sp)
tx = Transaction(doc, "test")
tx.Start()
for f in faces:
DrawFace(f)
tx.Commit()